- This topic has 2 replies, 2 voices, and was last updated 15 years, 7 months ago by shadow_tj.
-
AuthorPosts
-
April 21, 2009 at 2:30 pm #32867shadow_tjParticipant
Im changing my component set up to Alphaskins 6.22
Now im getting a crash on the TsSpeedButtons.
TsSpeedButton.ActionChange has the codeprocedure TsSpeedButton.ActionChange(Sender: TObject; CheckDefaults: Boolean);
begin
inherited ActionChange(Sender, CheckDefaults);
Images := TCustomAction(Sender).ActionList.Images;
ImageIndex := TCustomAction(Sender).ImageIndex;
SetFakeCaption;
FCommonData.BGChanged := True;
if not (csDestroying in ComponentState) and not (csLoading in ComponentState) then Repaint;
end;the problem is the Images…..
the TCustomAction(Sender).ActionList = NIL
so its crashes on the call the Images.im fixing this now with a check …
procedure TsSpeedButton.ActionChange(Sender: TObject; CheckDefaults: Boolean);
begin
inherited ActionChange(Sender, CheckDefaults);
if Assigned ( TCustomAction(Sender).ActionList ) then
Images := TCustomAction(Sender).ActionList.Images;
ImageIndex := TCustomAction(Sender).ImageIndex;
SetFakeCaption;
FCommonData.BGChanged := True;
if not (csDestroying in ComponentState) and not (csLoading in ComponentState) then Repaint;
end;watching the 5.23 code… there was always a check but in the 6.22 the check has been removed.
my question, why is this checked removed ??
April 21, 2009 at 4:00 pm #38752SupportKeymasterIn the v5.23 code we can see this :
CODEprocedure TsSpeedButton.ActionChange(Sender: TObject; CheckDefaults: Boolean);
begin
if Glyph.Empty {v4.72} and (TCustomAction(Sender).ActionList.Images nil) and (TCustomAction(Sender).ImageIndex > -1) then Glyph.Assign(nil); // v4.44
inherited ActionChange(Sender, CheckDefaults);
if Sender is TCustomAction then DoActionChanging(Self, TCustomAction(Sender));
FCommonData.Invalidate;
end;
And we hasn't a checking of the TCustomAction(Sender).ActionList there too <img src="style_emoticons//blush.gif” style=”vertical-align:middle” emoid=”:blush:” border=”0″ alt=”blush.gif” />
Seems, you hadn't error in the v5.23 because Glyph property was not empty?April 22, 2009 at 6:27 am #38768shadow_tjParticipantthere are images on the speedbuttons yes.
In the v5.23 code we can see this :CODEprocedure TsSpeedButton.ActionChange(Sender: TObject; CheckDefaults: Boolean);
begin
if Glyph.Empty {v4.72} and (TCustomAction(Sender).ActionList.Images nil) and (TCustomAction(Sender).ImageIndex > -1) then Glyph.Assign(nil); // v4.44
inherited ActionChange(Sender, CheckDefaults);
if Sender is TCustomAction then DoActionChanging(Self, TCustomAction(Sender));
FCommonData.Invalidate;
end;
And we hasn't a checking of the TCustomAction(Sender).ActionList there too <img src="style_emoticons//blush.gif” style=”vertical-align:middle” emoid=”:blush:” border=”0″ alt=”blush.gif” />
Seems, you hadn't error in the v5.23 because Glyph property was not empty? -
AuthorPosts
- You must be logged in to reply to this topic.