• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 689
  • Last Modified:

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
0
magma_george
Asked:
magma_george
  • 10
  • 8
  • 2
  • +1
1 Solution
 
shaneholmesCommented:
You will need to create your images in a resource file (use Image Editor)

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('ADD');
                          end;
            nbDelete : begin
                             Caption := 'Delete';
                             Glyph.LoadFromResource('DELETE');
                            end;

            nbPost   :begin
                           Caption := 'Post';
                            Glyph.LoadFromResource('POST');
                          end;
            nbCancel :begin
                            Caption := 'Cancel';
                           Glyph.LoadFromResource('CANCEL');  
                           end;
          end;
        end;

Let me know if you need help creating a resource file with your images

Shane
0
 
magma_georgeAuthor Commented:
well yes i would really need some help with the resource file if you
could ?
0
 
Ivanov_GCommented:

   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}

 
0
Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

 
Ivanov_GCommented:

  sorry my mistake - not RC_BITMAP - it is RT_BITMAP
0
 
KunfufaresiCommented:
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.

0
 
shaneholmesCommented:
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\Delphi7\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
0
 
magma_georgeAuthor Commented:
how do i compile that in the command line ?

0
 
shaneholmesCommented:
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\Delphi7\Projects\MyProject\NAVImages.rc


Shane



0
 
magma_georgeAuthor Commented:
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>

0
 
shaneholmesCommented:
Post me your path to the *.rc file here so i can see the entire thing you have

Example:

brcc32 C:\Progra~1\Borland\Delphi7\Projects\MyProject\NAVImages.rc


Notice how I have

Program Files =  Progra~1


Shane
0
 
magma_georgeAuthor Commented:
i could even send you my icons and the resource file so you could see


my path is C:\disp\icon

0
 
shaneholmesCommented:
you can email them to me at holmesshane AT charter DOT net
0
 
magma_georgeAuthor Commented:
HAVE YOU RECIVED ANYTHING

ZIPPED FOLDER
0
 
shaneholmesCommented:
Not Yet!

Shane
0
 
magma_georgeAuthor Commented:
not yet

let me send again

0
 
shaneholmesCommented:
I got it!

Shane
0
 
shaneholmesCommented:
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
0
 
shaneholmesCommented:
BRCC32 C:\disp\icon

does not do it

you need the file name as well

Example

BRCC32 C:\disp\icon\DBImages.rc


Shane
0
 
shaneholmesCommented:
Are you getting any of my emails, I keep getting email from you, but your not saying anything in them that makes me believe you are getting any of my email

Shane
0
 
magma_georgeAuthor Commented:
did you get it
0
 
magma_georgeAuthor Commented:
i am not getting any e-mail from you

0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: CompTIA Healthcare IT Tech

This course will help prep you to earn the CompTIA Healthcare IT Technician certification showing that you have the knowledge and skills needed to succeed in installing, managing, and troubleshooting IT systems in medical and clinical settings.

  • 10
  • 8
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now