magma_george
asked on
DBNavigator1 editing the buttons
hi
i have creaed a application with DBNavigator1 and database
but they come all together like > < stop and etc.
so now i need to put icons in them but they are in in one pice so i need to separate them and
put isons in them
any body has any ideas
res:
i need to maintain their functionallity.
thank you
i have creaed a application with DBNavigator1 and database
but they come all together like > < stop and etc.
so now i need to put icons in them but they are in in one pice so i need to separate them and
put isons in them
any body has any ideas
res:
i need to maintain their functionallity.
thank you
ASKER
well yes i would really need some help with the resource file if you
could ?
could ?
create empty text file names DBNavButtons.rc and open it with notepad. Fill it.
ADD RC_BITMAP add.bmp
DELETE RC_BITMAP delete.bmp
......
(etc)
Then from command line type : "brcc32 -v DBNavButtons". Brcc32 is the Borland resource compiler found in /bin folder in Delphi installation. It will produce DBNavButtons.res file
The last step - put somewhere this
{$R DBNavButtons.res}
sorry my mistake - not RC_BITMAP - it is RT_BITMAP
Hello,
Another solution might be to just build it yourself, if you drop a panel and add the buttons you need loding glyphs yourself into them. All the functions in the dbnavigator are available in the database object, like table.next, table.forward, table.post etc. you could add if table.eof then disable next, last, if table.readonly disable insert, post, delete etc.
Another solution might be to just build it yourself, if you drop a panel and add the buttons you need loding glyphs yourself into them. All the functions in the dbnavigator are available in the database object, like table.next, table.forward, table.post etc. you could add if table.eof then disable next, last, if table.readonly disable insert, post, delete etc.
magma_george,
Open up notepad and add an entry for each image:
Example:
ADD RC_BITMAP add.bmp
DELETE RC_BITMAP delete.bmp
EDIT RC_BITMAP Edit.bmp
POST RC_BITMAP post.bmp
REFRESH RC_BITMAP refresh.bmp
FIRST RC_BITMAP first.bmp
LAST RC_BITMAP last.bmp
NEXT RC_BITMAP next.bmp
PREV RC_BITMAP prev.bmp
save the file as NAVImages.rc
then use the Borlands resource compiler (found in the \Bin directory) to compile the *.rc file into a resource file which you can compile into your application
Example
brcc32 C:\Progra~1\Borland\Delphi 7\Projects \MyProject \NAVImages .rc
Then just add the resource to be compiled into your app as follows:
implementation
{$R *.dfm}
{$R NAVImages.res}
Hope this helps!
Shane
Open up notepad and add an entry for each image:
Example:
ADD RC_BITMAP add.bmp
DELETE RC_BITMAP delete.bmp
EDIT RC_BITMAP Edit.bmp
POST RC_BITMAP post.bmp
REFRESH RC_BITMAP refresh.bmp
FIRST RC_BITMAP first.bmp
LAST RC_BITMAP last.bmp
NEXT RC_BITMAP next.bmp
PREV RC_BITMAP prev.bmp
save the file as NAVImages.rc
then use the Borlands resource compiler (found in the \Bin directory) to compile the *.rc file into a resource file which you can compile into your application
Example
brcc32 C:\Progra~1\Borland\Delphi
Then just add the resource to be compiled into your app as follows:
implementation
{$R *.dfm}
{$R NAVImages.res}
Hope this helps!
Shane
ASKER
how do i compile that in the command line ?
click start button,
choose
Start/programs/accessories /command prompt
when the comman prompt window appears, type in
brcc32 <path to *.rc file>
Example:
brcc32 C:\Progra~1\Borland\Delphi 7\Projects \MyProject \NAVImages .rc
Shane
choose
Start/programs/accessories
when the comman prompt window appears, type in
brcc32 <path to *.rc file>
Example:
brcc32 C:\Progra~1\Borland\Delphi
Shane
ASKER
is there any other way because brcc32 seems to be not working
i don't know why
it says
error couldn't open the <path>
i don't know why
it says
error couldn't open the <path>
Post me your path to the *.rc file here so i can see the entire thing you have
Example:
brcc32 C:\Progra~1\Borland\Delphi 7\Projects \MyProject \NAVImages .rc
Notice how I have
Program Files = Progra~1
Shane
Example:
brcc32 C:\Progra~1\Borland\Delphi
Notice how I have
Program Files = Progra~1
Shane
ASKER
i could even send you my icons and the resource file so you could see
my path is C:\disp\icon
my path is C:\disp\icon
you can email them to me at holmesshane AT charter DOT net
ASKER
HAVE YOU RECIVED ANYTHING
ZIPPED FOLDER
ZIPPED FOLDER
Not Yet!
Shane
Shane
ASKER
not yet
let me send again
let me send again
I got it!
Shane
Shane
K. i emailed you back the compiled version - however, this does not help you for the future.
I asked you to post me what you were using for the paths to compile- but you failed to do so.
How are you expecting to learn if we can't show you where your mistakes are?
Me compiling it for you doesnot help you in the future
Shane
I asked you to post me what you were using for the paths to compile- but you failed to do so.
How are you expecting to learn if we can't show you where your mistakes are?
Me compiling it for you doesnot help you in the future
Shane
BRCC32 C:\disp\icon
does not do it
you need the file name as well
Example
BRCC32 C:\disp\icon\DBImages.rc
Shane
does not do it
you need the file name as well
Example
BRCC32 C:\disp\icon\DBImages.rc
Shane
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
did you get it
ASKER
i am not getting any e-mail from you
then use the following code to replace the Image or caption of the default buttons on the TDBNavigator:
with DBNavigator1 do
for c := 0 to ControlCount -1 do
if Controls[c] is TNavButton then
with TNavButton(Controls[c]) do
begin
Glyph := nil;
Font.Style := [fsBold];
case TNavigateBtn(c) of
nbInsert :begin
Caption := 'Add';
Glyph.LoadFromResource('AD
end;
nbDelete : begin
Caption := 'Delete';
Glyph.LoadFromResource('DE
end;
nbPost :begin
Caption := 'Post';
Glyph.LoadFromResource('PO
end;
nbCancel :begin
Caption := 'Cancel';
Glyph.LoadFromResource('CA
end;
end;
end;
Let me know if you need help creating a resource file with your images
Shane