Solved

the control of the bitmap lenght  of DBNavigator

Posted on 2004-04-23
4
369 Views
Last Modified: 2013-12-03
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
Comment
Question by:magma_george
  • 3
4 Comments
 
LVL 11

Expert Comment

by:shaneholmes
ID: 10905663
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
 

Author Comment

by:magma_george
ID: 10908017
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
 
LVL 11

Expert Comment

by:shaneholmes
ID: 10908076
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
 
LVL 11

Accepted Solution

by:
shaneholmes earned 500 total points
ID: 10908229
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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now