Jump to content

UnimSegmentedButton Set Button Pressed programmatically


gerhardhziegler

Recommended Posts

3 hours ago, gerhardhziegler said:

Good morning, folks!

Is there any possibility to set the state of an UnimSegmentedButton programmatically?
UnimSegmentedButton.Items[n].Pressed:=True or False doesnt show any reaction.

 

Best regards!

Seems to be a sencha problem as well.

Additional question: How can I set a BADGE for an Segmented Button? No Chance, I assume.

Link to comment
Share on other sites

6 hours ago, gerhardhziegler said:

Is there any possibility to set the state of an UnimSegmentedButton programmatically?
UnimSegmentedButton.Items[n].Pressed:=True or False doesnt show any reaction.

  with UnimSegmentedButton1 do
  begin
    Items[0].Pressed := True;
    JSInterface.JSCall('setPressed', [True], Items[0].JSMenuItem);
  end;

 

  • Like 1
Link to comment
Share on other sites

6 hours ago, gerhardhziegler said:

May I continue asking of there is a solution for a badge for one of these SegmentedButtons.

Hi,

Can you try this?

UnimFormReady:

procedure TMainmForm.UnimFormReady(Sender: TObject);
begin
  with UnimSegmentedButton1 do
  begin
    JSInterface.JSCall('setBadgeText', [10], Items[0].JSMenuItem);
    JSInterface.JSCode('var me='#1'.badgeElement; me.setY(parseInt(me.getY()+4)); me.setStyle("left", null);', Items[0].JSMenuItem);
  end;

end;

SetBadgeText, for example:

with UnimSegmentedButton1 do
  JSInterface.JSCall('setBadgeText', ['2019'], Items[0].JSMenuItem);

 

  • Like 1
  • Upvote 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...