TsSpeedButton.ActionChange crash 6.22

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #32867
    shadow_tj
    Participant

    Im changing my component set up to Alphaskins 6.22

    Now im getting a crash on the TsSpeedButtons.
    TsSpeedButton.ActionChange has the code

    procedure 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 ??

    #38752
    Support
    Keymaster

    In the v5.23 code we can see this :

    CODE
    procedure 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?

    #38768
    shadow_tj
    Participant

    there are images on the speedbuttons yes.

    QUOTE (Support @ Apr 21 2009, 06:00 PM)
    In the v5.23 code we can see this :

    CODE
    procedure 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?

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.