[Module] ButtonEx (all OS)

Applications, Games, Tools, User libs and useful stuff coded in PureBasic
User avatar
Thorsten1867
Addict
Addict
Posts: 1366
Joined: Wed Aug 24, 2005 4:02 pm
Location: Germany

Re: [Module] ButtonEx (all OS)

Post by Thorsten1867 »

Update:
  • Bugfixes
  • Support of #LF$ for multiline - buttons
Translated with http://www.DeepL.com/Translator

Download of PureBasic - Modules
Download of PureBasic - Programs

[Windows 11 x64] [PB V5.7x]
User avatar
doctorized
Addict
Addict
Posts: 854
Joined: Fri Mar 27, 2009 9:41 am
Location: Athens, Greece

Re: [Module] ButtonEx (all OS)

Post by doctorized »

Set text to #BUTTONML to "Nokia Phone" and after line

Code: Select all

Debug "Multiline button pressed"
add:

Code: Select all

ButtonEx::SetText(#ButtonML, ButtonEx::GetText(#ButtonML) + #LF$ + "5")
and see that the text goes on the top of the button and not in the middle. (SetText() and GetText() are in my last post with your code.)
User avatar
Thorsten1867
Addict
Addict
Posts: 1366
Joined: Wed Aug 24, 2005 4:02 pm
Location: Germany

Re: [Module] ButtonEx (all OS)

Post by Thorsten1867 »

Bug fixed
Translated with http://www.DeepL.com/Translator

Download of PureBasic - Modules
Download of PureBasic - Programs

[Windows 11 x64] [PB V5.7x]
User avatar
Thorsten1867
Addict
Addict
Posts: 1366
Joined: Wed Aug 24, 2005 4:02 pm
Location: Germany

Re: [Module] ButtonEx (all OS)

Post by Thorsten1867 »

Update: dynamic text size (needs ModuleEx.pbi)
Translated with http://www.DeepL.com/Translator

Download of PureBasic - Modules
Download of PureBasic - Programs

[Windows 11 x64] [PB V5.7x]
Cyllceaux
Enthusiast
Enthusiast
Posts: 458
Joined: Mon Jun 23, 2014 1:18 pm
Contact:

Re: [Module] ButtonEx (all OS)

Post by Cyllceaux »

Line 64: XIncludeFile "ModuleEx.pbi"
User avatar
Thorsten1867
Addict
Addict
Posts: 1366
Joined: Wed Aug 24, 2005 4:02 pm
Location: Germany

Re: [Module] ButtonEx (all OS)

Post by Thorsten1867 »

Fixed
Translated with http://www.DeepL.com/Translator

Download of PureBasic - Modules
Download of PureBasic - Programs

[Windows 11 x64] [PB V5.7x]
Cyllceaux
Enthusiast
Enthusiast
Posts: 458
Joined: Mon Jun 23, 2014 1:18 pm
Contact:

Re: [Module] ButtonEx (all OS)

Post by Cyllceaux »

Yes... looks great :)

Next "problem"... the popupmenu is not really in place.
My Button is 120px. the arrow-button is at the right side. The popup shows on the left side.
User avatar
Thorsten1867
Addict
Addict
Posts: 1366
Joined: Wed Aug 24, 2005 4:02 pm
Location: Germany

Re: [Module] ButtonEx (all OS)

Post by Thorsten1867 »

Cyllceaux wrote:Yes... looks great :)

Next "problem"... the popupmenu is not really in place.
My Button is 120px. the arrow-button is at the right side. The popup shows on the left side.
I still haven't found a way to determine the width of the popup menu to position it right-aligned.
Translated with http://www.DeepL.com/Translator

Download of PureBasic - Modules
Download of PureBasic - Programs

[Windows 11 x64] [PB V5.7x]
Cyllceaux
Enthusiast
Enthusiast
Posts: 458
Joined: Mon Jun 23, 2014 1:18 pm
Contact:

Re: [Module] ButtonEx (all OS)

Post by Cyllceaux »

Thorsten1867 wrote:
Cyllceaux wrote:Yes... looks great :)

Next "problem"... the popupmenu is not really in place.
My Button is 120px. the arrow-button is at the right side. The popup shows on the left side.
I still haven't found a way to determine the width of the popup menu to position it right-aligned.
Maybe line 682 to:

Code: Select all

DisplayPopupMenu(BtEx()\PopupNum, WindowID(BtEx()\Window\Num), dpiX(dX)+GadgetWidth(BtEx()\CanvasNum)-dpiy(20), dpiY(dY))
Cyllceaux
Enthusiast
Enthusiast
Posts: 458
Joined: Mon Jun 23, 2014 1:18 pm
Contact:

Re: [Module] ButtonEx (all OS)

Post by Cyllceaux »

Can wie do the Disable thing, here, too?
User avatar
Thorsten1867
Addict
Addict
Posts: 1366
Joined: Wed Aug 24, 2005 4:02 pm
Location: Germany

Re: [Module] ButtonEx (all OS)

Post by Thorsten1867 »

Update: Added Attribute '#Corner'
Translated with http://www.DeepL.com/Translator

Download of PureBasic - Modules
Download of PureBasic - Programs

[Windows 11 x64] [PB V5.7x]
Cyllceaux
Enthusiast
Enthusiast
Posts: 458
Joined: Mon Jun 23, 2014 1:18 pm
Contact:

Re: [Module] ButtonEx (all OS)

Post by Cyllceaux »

yeah... great 8)

Can I have a GetText for the button?

and a GetData and SetData?
User avatar
Thorsten1867
Addict
Addict
Posts: 1366
Joined: Wed Aug 24, 2005 4:02 pm
Location: Germany

Re: [Module] ButtonEx (all OS)

Post by Thorsten1867 »

Update:
  • ButtonEx::GetText()
  • ButtonEx::SetData() / ButtonEx::GetData()
Translated with http://www.DeepL.com/Translator

Download of PureBasic - Modules
Download of PureBasic - Programs

[Windows 11 x64] [PB V5.7x]
User avatar
doctorized
Addict
Addict
Posts: 854
Joined: Fri Mar 27, 2009 9:41 am
Location: Athens, Greece

Re: [Module] ButtonEx (all OS)

Post by doctorized »

Is there a way to have a button like this one?
http://users.sch.gr/arahiotis/other/button.png
User avatar
Thorsten1867
Addict
Addict
Posts: 1366
Joined: Wed Aug 24, 2005 4:02 pm
Location: Germany

Re: [Module] ButtonEx (all OS)

Post by Thorsten1867 »

This is very special, but theoretically you could adjust ButtonEx accordingly.
With SetText() pass the 2 additional strings and let the Draw_() routine draw them.
Translated with http://www.DeepL.com/Translator

Download of PureBasic - Modules
Download of PureBasic - Programs

[Windows 11 x64] [PB V5.7x]
Post Reply