TComboBoxEx Styles lazarus / 31-LCL ---------------------------------------------------------------------- fatmonk · 2015-02-20 10:54 In 1.4RC1 a new (old Delphi?) component has been added - TComboBoxEx which allows image icons to be included alongside options in a drop down list / combo-box. However, the 3 style options available for the component all appear to be the same - both in appearance and function. (with the standard TComboBox component the functionality of the control and its appearance change when changing the style - some styles look like buttons, some like text field, some allow typing in the field, some only allow selection of existing options) Is this by design or is something not working quite right with TComboBoxEx yet? (Or am I missing something?) Thanks, FM (the attached shows what I am seeing) ---------------------------------------------------------------------- Blaazen · 2015-02-20 12:20 Yes, this is by design. Both TCheckComboBox and TComboBoxEx are csOwnerDrawFixed and ReadOnly. New Style and StyleEx properties are there moreless for Delphi compatibility. Maybe some widgetsets are capable to do editable combo with image, I don't know. ---------------------------------------------------------------------- fatmonk · 2015-02-20 12:23 I actually don't need/want it to be editable, but I'd like to be able to set the appearance to look like the top drop-down in the attached image - that's a TComboBox with Style set to csDropDownList. -FM ---------------------------------------------------------------------- zeljko · 2015-02-20 14:20 Quote from: fatmonk on February 20, 2015, 01:23:57 pmI actually don't need/want it to be editable, but I'd like to be able to set the appearance to look like the top drop-down in the attached image - that's a TComboBox with Style set to csDropDownList. -FM Actually, such look is same as with Qt QComboBox where style <> csDropDown (only editable is with csDropDown) ---------------------------------------------------------------------- balazsszekely · 2015-02-20 14:20 It's working fine in delphi, so you should port it from there. You can find in ComCtrls unit(TComboBoxEx/TCustomComboBoxEx). Proof: ---------------------------------------------------------------------- wp · 2015-02-20 14:32 QuoteIt's working fine in delphi, so you should port it from there.NO NO NO NO NO - don't even think of looking into Delphi's sources. Embarcadero will kill Lazarus because of copyright issues! ---------------------------------------------------------------------- fatmonk · 2015-02-20 14:38 @GetMem - That's exactly the look I'm looking for. @wp - Is there any way to achieve this legally? -FM ---------------------------------------------------------------------- balazsszekely · 2015-02-20 14:46 Quote@wp NO NO NO NO NO - don't even think of looking into Delphi's sources. Embarcadero will kill Lazarus because of copyright issues!In my opinion Embarcadero will be the dead one...however your point is still valid, so @fatmonk forget the idea! @fatmonk It shouldn't be to difficult,  but it's not trivial either. ---------------------------------------------------------------------- wp · 2015-02-20 14:48 Quote@wp - Is there any way to achieve this legally?No. Look how TCombobox (of Lazarus!) does it and adapt TComboboxEx accordingly. TComboboxEx inherits from TCustomCombobox --> it must be possible without stealing from Delphi. ---------------------------------------------------------------------- fatmonk · 2015-02-20 14:56 I started to try to dig into that but didn't get very far I'm afraid - it's getting a bit beyond me. I'd love to tackle it, but would need some pointers as to where to look. Looking in comboboxex.pas and StdCtrls.pp (both in the lcl directory) I can see the declarations for the different options being available, but then I'm at a dead end... ---------------------------------------------------------------------- fatmonk · 2015-02-20 15:17 The Brush property looked promising - inherited via controls.pp But it has a padlock so maybe not configurable... even though ComboBoxEx1.Brush.Style:=bsHorizontal; gives no compile time error, it also seems to make no difference to the appearance of the control. -FM ---------------------------------------------------------------------- zeljko · 2015-02-21 21:14 Try to draw themed button for that part of combobox. ---------------------------------------------------------------------- fatmonk · 2015-02-23 13:19 I'm going to need an easier clue than that I'm afraid... How would I go about drawing a themed button rather than the standard? Thanks, FM