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

the control of the bitmap lenght of DBNavigator

how can we control the size of the bitmap on each DBNavigator  because now it
taking width:14 height:6.5 that's the size of the bitmap on each DBNavigator  
i want it to be able to take control of the amount of space taken by the bitmap

 case TNavigateBtn(I) of
 
    nbPrior : begin
                  Caption := 'Add';
                  Glyph.LoadFromResourceName(HInstance, 'PRIOR');
                  end;
 
     nbInsert :begin
                Caption := 'Add';
                Glyph.LoadFromResourceName(HInstance, 'ADD');
               end;
   
0
magma_george
Asked:
magma_george
  • 3
1 Solution
 
shaneholmesCommented:
George, You need to create the size of the bitmaps you want, then recompile the Resource file with the new images

Then  if the images are to large for the buttons, you will have to adjust the width of your buttons at runtime (in your code)

For example:

I used buttons which are 50 X 50 in the code below, look for the (//***** NEW *****) for the changes to your code

Shane



with DBNavigator1 do
begin//***** NEW *****
for I := 0 to ControlCount -1 do
 if Controls[I] is TNavButton then
  with TNavButton(Controls[I]) do
  begin
   Glyph := nil;
   Font.Style := [fsBold];
   Layout:= blGlyphTop;
   Width:= 50; //***** NEW *****
   Height:= 50; //***** NEW *****
   case TNavigateBtn(I) of
    nbInsert :begin
               Caption := 'Add';
               Glyph.LoadFromResourceName(HInstance, 'ADD');
              end;
    nbDelete : begin
                Caption := 'Delete';
                Glyph.LoadFromResourceName(HInstance, 'DELETE');
               end;

     nbPost   :begin
                Caption := 'Post';
                Glyph.LoadFromResourceName(HInstance, 'POST');
               end;
     nbCancel :begin
                Caption := 'Cancel';
                Glyph.LoadFromResourceName(HInstance, 'CANCEL');
               end;
     nbFirst :begin
               Caption := 'First';
               Glyph.LoadFromResourceName(HInstance, 'FIRST');
              end;
     nbLast :begin
               Caption := 'Last';
               Glyph.LoadFromResourceName(HInstance, 'LAST');
              end;
     nbNext :begin
               Caption := 'Next';
               Glyph.LoadFromResourceName(HInstance, 'NEXT');
              end;
     end;
  end;
  Width:= (ControlCount - 1) * 50; ////***** NEW *****
 end;//***** NEW *****


try it like this


then create new larger button glyphs, recompile your resource
and adjust the sizes (50) accordingly


Shane
0
 
magma_georgeAuthor Commented:
hi Shane

well i have been trying to get this Glyph thing to work but i am missing something

well
i took the image and i added it ot the resource file
now i builded the project and the display is following

1/2 of the icon is dispalyed and then another 1/2 after i click anyof the buttons on theDBNavigator2 and i want to have the whole Glyph in that button

 it changes when i press the add buttons on the DBNavigator2

i changed the button size many times but that woudln't help

thanks
0
 
shaneholmesCommented:
George, each image must consist of the normal image & the disabled image together

for example,

if  I have a image 24 X 24, then i also need a disabled version of that image (24 X 24) as well

then i combile them to make a image


48 X 24

Regular Image + Disabled image

Each image this has to be done to.

THATS WHY I ASKED YOU YESTERDAY TO LOAD THE dbctrl.res file in your \lib folder so you could see how it is done!

Then again, you dont ever do as i say......

Shane
0
 
shaneholmesCommented:
Yes, there is a disabled image for each of those images I sent you

EACH ONE! Has a normal and EACH ONE! Has a disabled

Look at how they are combined in the dbctrl.res file, then duplicate that with the images i gave you


Shane
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now