Delphi Pages Forums  

Go Back   Delphi Pages Forums > Delphi Forum > DB-Aware

Lost Password?

Reply
 
Thread Tools Display Modes
  #1  
Old 08-16-2004, 11:17 PM
Chesso Chesso is offline
Senior Member
 
Join Date: May 2004
Location: Sydney, Australia
Posts: 1,199
Default problem with TSpeedButton.

Code:
Procedure TFrmMain.SBPenClick(Sender: TObject);
Begin
If (Pen = False) Then
 Begin
    Pen := True;
    PenGlyph.LoadFromResourceName(hInstance, 'Pen');
    SBPen.Glyph := PenGlyph;
 End
Else If (Pen = True) Then
 Begin
    Pen := False;
    PenGlyph.LoadFromResourceName(hInstance, 'NoPen');
    SBPen.Glyph := PenGlyph;
 End;
End;
That works fine except the glyph is not changing and even when button is clicked it does what it's told me except what i mentioned before but doesnt push in and out like a button should as if it isn't updating or something.

These buttons are on an MdiForm with a MdiChild sitting next to them im using for drawing on.
Reply With Quote
  #2  
Old 08-16-2004, 11:32 PM
MerijnB MerijnB is offline
Senior Member
 
Join Date: Mar 2001
Posts: 452
Default RE: problem with TSpeedButton.

did you take a look at the down property of the speedbutton ?
Reply With Quote
  #3  
Old 08-16-2004, 11:37 PM
Chesso Chesso is offline
Senior Member
 
Join Date: May 2004
Location: Sydney, Australia
Posts: 1,199
Default RE: problem with TSpeedButton.

i know how to set it down state and up and tht didnt work either nothing does the event proceses but the button won't change state nor glyph like im trying to do.
Reply With Quote
  #4  
Old 08-17-2004, 12:25 AM
Norrit Norrit is offline
Moderator
 
Join Date: Aug 2001
Location: Landgraaf
Posts: 6,699
Default RE: problem with TSpeedButton.

Not sure, but Perhaps you'll need to Repaint or Refresh your speedbutton ???
Because now you only load a new icon, but nowhere you paint the icon ...

MvG
Peter

Objective reality is a delirium caused by lack of alcohol in blood.
24 hous in a day, 24 beers in a case. Coincidence ???
Reply With Quote
  #5  
Old 08-17-2004, 07:11 AM
Chesso Chesso is offline
Senior Member
 
Join Date: May 2004
Location: Sydney, Australia
Posts: 1,199
Default RE: problem with TSpeedButton.

ive tryed tht too.........also ive tryed refresh/repaint and paint the form.
Reply With Quote
  #6  
Old 08-17-2004, 11:49 PM
hq hq is offline
Senior Member
 
Join Date: Nov 2002
Posts: 115
Default RE: problem with TSpeedButton.

I dont realy like using the resource to lode glyphs
but thats only becouse I discoverd LMD SE ..
LMD SE is free and you can use it in your app is has a very nice bitmaplist with this control I would do somthing like this

var
bPen : boolean;

Procedure TFrmMain.SBPenClick(Sender : TObject);
var
bitList : TLMDBITMAPLIST;
begin

bitlist := TLMDBITMAPLIST.CREATE(Self);
bitlist.loadfromfile('\<Filelocation>\my.bml');

if bPen then
begin
bpen := False;
SBPen.Glyph.Assign(bitlist.Items[0].Bitmap);
end
else
begin

if bPen = False then
begin
bpen := True;
SBPen.Glyph.Assign(bitlist.Items[1].Bitmap);
end;

end;
freeandnil(Bitlist);
end;

this work for me every time

Help is good
Reply With Quote
  #7  
Old 08-18-2004, 12:14 AM
Chesso Chesso is offline
Senior Member
 
Join Date: May 2004
Location: Sydney, Australia
Posts: 1,199
Default RE: problem with TSpeedButton.

thnks for the suggestion but i fixed it sorta :P i hide the control before glyph change and then show it it doesnt flicker or take ages to do it so it's all good dis way
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 07:00 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2013, vBulletin Solutions, Inc.