open drop down box using wxComboBox ?

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Post Reply
Thelvyn
Earned a small fee
Earned a small fee
Posts: 23
Joined: Sun Feb 26, 2006 8:03 pm
Location: Linwood Pa USA
Contact:

open drop down box using wxComboBox ?

Post by Thelvyn »

Is there a way to have the dropdown box open using this class ?
I dont see anything that would do this.
TIA
DavidHart
Site Admin
Site Admin
Posts: 4252
Joined: Thu Jan 12, 2006 6:23 pm
Location: IoW, UK

Post by DavidHart »

Hi,

If you're using MSWindows (which I don't) then I understand the following line from the docs to mean what you want:
wxCB_SIMPLE Creates a combobox with a permanently displayed list. Windows only.

If you're not using MSWindows, you would have to try to hack into the underlying control (in wxGTK that means a gtk widget). You'd be better off using a wxListBox ;)

Regards,

David
Thelvyn
Earned a small fee
Earned a small fee
Posts: 23
Joined: Sun Feb 26, 2006 8:03 pm
Location: Linwood Pa USA
Contact:

Post by Thelvyn »

I dont want it permanently displayed. When they type something in the edit box (which is a wxTextCtrl I believe) of the combo box and there is an item that matches in the combo box I want to display it by having the combo drop down.

Basically im trying to do something like what happens when you type urls in the address bar of firefox. Just type in www. for example and the drop down part opens up and shows relevant items. Thats what I am trying to do here.
This is a command bar where they type commands and I autocomplete them(if turned on anyway) as they type to save them from having to type the whole command out.
phlox81
wxWorld Domination!
wxWorld Domination!
Posts: 1387
Joined: Thu Aug 18, 2005 7:49 pm
Location: Germany
Contact:

Post by phlox81 »

Take a look at the codedump forum, there was a class posted some days ago, which is able to this.
Thelvyn
Earned a small fee
Earned a small fee
Posts: 23
Joined: Sun Feb 26, 2006 8:03 pm
Location: Linwood Pa USA
Contact:

Post by Thelvyn »

Unfortunately I never did find a solution to this. The code you pointed me to was not quite what I had in mind thank you though.
micros
Super wx Problem Solver
Super wx Problem Solver
Posts: 317
Joined: Sat Mar 18, 2006 10:41 am
Location: Ustek, Bohemia

Post by micros »

On Windows, this should do:

Code: Select all

SendMessage(
  (HWND)combox->GetHandle(),
  CB_SHOWDROPDOWN /* 0x014F */,
  TRUE, 0);
Thelvyn
Earned a small fee
Earned a small fee
Posts: 23
Joined: Sun Feb 26, 2006 8:03 pm
Location: Linwood Pa USA
Contact:

Post by Thelvyn »

I need this to work in linux as well, is there a wxWhatever define to do this ?
I would think that it would have something to do with events but how ?
Post Reply