Recent

Author Topic: TComboBoxEx Styles  (Read 7349 times)

fatmonk

  • Sr. Member
  • ****
  • Posts: 252
TComboBoxEx Styles
« on: February 20, 2015, 11:54:46 am »
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

  • Hero Member
  • *****
  • Posts: 3241
  • POKE 54296,15
    • Eye-Candy Controls
Re: TComboBoxEx Styles
« Reply #1 on: February 20, 2015, 01:20:21 pm »
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.
Lazarus 2.3.0 (rev main-2_3-2863...) FPC 3.3.1 x86_64-linux-qt Chakra, Qt 4.8.7/5.13.2, Plasma 5.17.3
Lazarus 1.8.2 r57369 FPC 3.0.4 i386-win32-win32/win64 Wine 3.21

Try Eye-Candy Controls: https://sourceforge.net/projects/eccontrols/files/

fatmonk

  • Sr. Member
  • ****
  • Posts: 252
Re: TComboBoxEx Styles
« Reply #2 on: February 20, 2015, 01:23:57 pm »
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

  • Hero Member
  • *****
  • Posts: 1792
    • http://wiki.lazarus.freepascal.org/User:Zeljan
Re: TComboBoxEx Styles
« Reply #3 on: February 20, 2015, 03:20:01 pm »
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

Actually, such look is same as with Qt QComboBox where style <> csDropDown (only editable is with csDropDown)

balazsszekely

  • Guest
Re: TComboBoxEx Styles
« Reply #4 on: February 20, 2015, 03:20:46 pm »
It's working fine in delphi, so you should port it from there. You can find in ComCtrls unit(TComboBoxEx/TCustomComboBoxEx).
Proof:

wp

  • Hero Member
  • *****
  • Posts: 13199
Re: TComboBoxEx Styles
« Reply #5 on: February 20, 2015, 03:32:07 pm »
Quote
It'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

  • Sr. Member
  • ****
  • Posts: 252
Re: TComboBoxEx Styles
« Reply #6 on: February 20, 2015, 03:38:40 pm »
@GetMem - That's exactly the look I'm looking for.

@wp - Is there any way to achieve this legally?

-FM

balazsszekely

  • Guest
Re: TComboBoxEx Styles
« Reply #7 on: February 20, 2015, 03:46:13 pm »
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

  • Hero Member
  • *****
  • Posts: 13199
Re: TComboBoxEx Styles
« Reply #8 on: February 20, 2015, 03:48:35 pm »
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

  • Sr. Member
  • ****
  • Posts: 252
Re: TComboBoxEx Styles
« Reply #9 on: February 20, 2015, 03:56:55 pm »
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

  • Sr. Member
  • ****
  • Posts: 252
Re: TComboBoxEx Styles
« Reply #10 on: February 20, 2015, 04:17:37 pm »
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

  • Hero Member
  • *****
  • Posts: 1792
    • http://wiki.lazarus.freepascal.org/User:Zeljan
Re: TComboBoxEx Styles
« Reply #11 on: February 21, 2015, 10:14:07 pm »
Try to draw themed button for that part of combobox.

fatmonk

  • Sr. Member
  • ****
  • Posts: 252
Re: TComboBoxEx Styles
« Reply #12 on: February 23, 2015, 02:19:06 pm »
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

 

TinyPortal © 2005-2018