ImpulseAdventure / GUIslice-Builder

Cross-platform drag & drop GUI builder for GUIslice
Other
163 stars 34 forks source link

Request: Add a feature for BTN to execute a custom code. #198

Closed nadjet09 closed 2 years ago

nadjet09 commented 2 years ago

Describe the solution you'd like if possible make the button to be able to execute a line of code or function from CbBtnCommon() with or without jump to page or show popup . in the button's property view, is it possible to add an input for plain text with the Jump Page Enum and Popup Page Enum. like in this pictures showing where it might be.

Gui-text
raging

Additional context I've been using Jump page Enum to paste the functions that I want to execute by button instead of doing jump page or popup, but as you see the output is like this:

Function-Button
raging

sometimes it's useful when copy/paste the button to different pages or projects, so it automatically keeps the behaviour.

Pconti31 commented 2 years ago

@nadjet09 I suppose I could put in an "Add Code" property as long as no one expects me to any syntax checking. It would also replace (turn off) the Jump Page auto coding so you would need to actually put in the full gslc_SetPageCur() yourself when or if needed. Paul--

nadjet09 commented 2 years ago

it totally makes sense to understand syntax is the user's responsibility.

Pconti31 commented 2 years ago

@nadjet09 Completed in Release 0.17.b10. You can use Custom Code property for Text and Image buttons.

The user guide has been updated, see section 4.19 Text Button for details. Note that while you can editing code inside the dialog after pressing [...] by double clicking on a line it really does suck compared to using a text editor. It's the best I could do at the moment.

attached is an example using the new feature. ex_btn_code.zip Paul--