Page 1 of 2

[Module] ComboBoxEx Gadget (all OS)

Posted: Thu Dec 05, 2019 6:08 pm
by Thorsten1867
ComboBoxEx Gadget - Module (all OS / DPI / 64Bit)
  • Replace the arrow with an image possible
  • colors for single rows
  • automatic size adjustment
  • support of GUI themes (needs ModuleEx.pbi)
Image ___ Image

Code: Select all

; ComboBoxEx::AddItem()            - similar to 'AddGadgetItem()'
; ComboBoxEx::AttachPopupMenu()    - attach a popup menu to the list
; ComboBoxEx::Copy()               - copy selection to clipboard
; ComboBoxEx::Cut()                - cut selection to clipboard
; ComboBoxEx::Delete()             - delete selection
; ComboBoxEx::ClearItems()         - similar to 'ClearGadgetItems()'
; ComboBoxEx::CountItems()         - similar to 'CountGadgetItems()'
; ComboBoxEx::Disable()            - similar to 'DisableGadget()'
; ComboBoxEx::GetData()            - similar to 'GetGadgetData()'
; ComboBoxEx::GetID()              - similar to 'GetGadgetData()', but string instead of quad
; ComboBoxEx::GetColor()           - similar to 'GetGadgetColor()'
; ComboBoxEx::GetItemData()        - similar to 'GetGadgetItemData()'
; ComboBoxEx::GetItemLabel()       - similar to 'GetGadgetItemData()', but string instead of quad
; ComboBoxEx::GetItemText()        - similar to 'GetGadgetItemText()'
; ComboBoxEx::GetLabelText()       - similar to 'GetGadgetItemText()', but label instead of row
; ComboBoxEx::GetState()           - similar to 'GetGadgetState()'
; ComboBoxEx::GetText()            - similar to 'GetGadgetText()'
; ComboBoxEx::Gadget()             - similar to 'ComboBoxGadget()'
; ComboBoxEx::Hide()               - similar to 'HideGadget()'
; ComboBoxEx::Paste()              - paste clipboard
; ComboBoxEx::RemoveItem()         - similar to 'RemoveGadgetItem()'
; ComboBoxEx::SetAttribute()       - similar to 'SetGadgetAttribute()'
; ComboBoxEx::SetAutoResizeFlags() - [#MoveX|#MoveY|#Width|#Height]
; ComboBoxEx::SetColor()           - similar to 'SetGadgetColor()'
; ComboBoxEx::SetData()            - similar to 'SetGadgetData()'
; ComboBoxEx::SetFont()            - similar to 'SetGadgetFont()'
; ComboBoxEx::SetID()              - similar to 'SetGadgetData()', but string instead of quad
; ComboBoxEx::SetImage()           - replace the arrow with an image
; ComboBoxEx::SetItemColor()       - similar to 'SetGadgetItemColor()'
; ComboBoxEx::SetItemData()        - similar to 'SetGadgetItemData()'
; ComboBoxEx::SetItemImage()       - similar to 'SetGadgetItemImage()'
; ComboBoxEx::SetItemText()        - similar to 'SetGadgetItemText()'
; ComboBoxEx::SetLabelText()       - similar to 'SetGadgetItemText()', but label instead of row
; ComboBoxEx::SetState()           - similar to 'SetGadgetState()'
; ComboBoxEx::SetText()            - similar to 'SetGadgetText()'
Download: ComboBoxExModule.pbi

Re: [Module] ComboBoxEx Gadgeat (all OS)

Posted: Tue Dec 10, 2019 3:37 pm
by Thorsten1867
Update: #MultiSelect flag added

Re: [Module] ComboBoxEx Gadgeat (all OS)

Posted: Sat Dec 28, 2019 11:15 am
by Thorsten1867
Bugfix: ComboBoxEx::SetState()

Re: [Module] ComboBoxEx Gadgeat (all OS)

Posted: Fri Feb 14, 2020 8:34 am
by Thorsten1867
Update: Scrollbar added

Re: [Module] ComboBoxEx Gadgeat (all OS)

Posted: Mon Mar 02, 2020 9:50 am
by Thorsten1867
Update: ScrollBarGadget() replaced by drawing routine

Re: [Module] ComboBoxEx Gadgeat (all OS)

Posted: Thu Mar 05, 2020 4:16 pm
by Thorsten1867
Update:
  • Attribute #ScrollBar [#ScrollBar_Default/#ScrollBar_Frame/#ScrollBar_DragPoint]
  • SetColor() -> [#ScrollBar_FrontColor/#ScrollBar_BackColor/#ScrollBar_BorderColor/#ScrollBar_ButtonColor/#ScrollBar_ThumbColor]

Re: [Module] ComboBoxEx Gadgeat (all OS)

Posted: Tue May 05, 2020 9:55 am
by ozzie
Not sure if I'm doing something wrong. I have a test program that uses ComboBoxExModule.pbi dated 07.03.2020, and ModuleEx.pbi dated 10.04.2020, but when I compile the test program I get this error in ComboBoxExModule:
Line 1673: Structure field not found: ScrollBar

Do I need to include any other modules? I'm using PB 5.71 under Windows 10.

Re: [Module] ComboBoxEx Gadgeat (all OS)

Posted: Tue May 05, 2020 11:47 am
by Thorsten1867
I have tested the last version and uploaded it again.
Please try it again.

Re: [Module] ComboBoxEx Gadget (all OS)

Posted: Wed May 06, 2020 2:20 am
by ozzie
Thanks, but compilation now fails in ComboBoxExModule at Line 1692: Structure field not found: FocusBack.

This also occurs if I just compile ComboBoxExModule.pbi.

Re: [Module] ComboBoxEx Gadget (all OS)

Posted: Wed May 06, 2020 11:57 am
by Thorsten1867
Fixed

Re: [Module] ComboBoxEx Gadget (all OS)

Posted: Wed May 06, 2020 11:46 pm
by ozzie
Thanks. All OK now.

Re: [Module] ComboBoxEx Gadget (all OS)

Posted: Fri Mar 05, 2021 12:37 am
by IdeasVacuum
Hi Thorsten

Playing with the example in the module :D

Code: Select all

If ComboBoxEx::Gadget(#ComboEx, 10, 40, 150, 40, 100, "", ComboBoxEx::#BorderLess, #Window)
The numbers - x,y, gadget width, gadget height, text width. Is that correct?

It is defaulting to a standard height of 20 and my icons are squeezed to 4 x 16 pix from 34 x 34 pix

Re: [Module] ComboBoxEx Gadget (all OS)

Posted: Wed May 18, 2022 4:00 pm
by Thorsten1867
Update:
  • New Scrollbar
  • New DPI-management

Re: [Module] ComboBoxEx Gadget (all OS)

Posted: Sun Mar 19, 2023 10:25 pm
by jak64
Hello Thorsten1867,

I modified my program to color a line of my ComboBox, but I can't do it, the line does not get colored.

1) To test, I added:

Code: Select all

IncludeFile "D:\Purebasic\MY MUSIC\ComboBoxEx\ComboBoxEx\ComboBoxExModule.pbi"
on the front line of my program.

2) I modified my code as follows for the example, I want to put line 2 in red.

Code: Select all

ResetList(ListNameDirectories())
   While NextElement(ListNameDirectories())
     With ListNameDirectories()
       AddGadgetItem(#ComboDisplayDirectories, -1, \NameDirectory)
     EndWith
   Wend
   ComboBoxEx::SetItemColor(#ComboDisplayDirectories,2,#Red)


The comboBox contains almost 2000 elements.

When I run the program, no error but when I open my ComboBox, no line is displayed in red.

Can you help me ?

Re: [Module] ComboBoxEx Gadget (all OS)

Posted: Sun Mar 19, 2023 11:53 pm
by Mindphazer
You need to use

Code: Select all

ComboBoxEx::Gadget()
to create your combo box gadget,
and

Code: Select all

ComboBoxEx::AddItem() 
instead of AddGadgetItem() to populate it