Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

the control of the bitmap lenght  of DBNavigator

Posted on 2004-04-23
4
Medium Priority
?
383 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 2000 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
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…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
Suggested Courses

618 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