[wx-dev] [ wxwindows-Patches-1941399 ] MSW Native wxBitmapComboBox
SourceForge.net
noreply at sourceforge.net
Thu May 1 08:27:08 PDT 2008
Patches item #1941399, was opened at 2008-04-13 19:21
Message generated for change (Comment added) made by jmsalli
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=309863&aid=1941399&group_id=9863
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: MSW specific
Group: new feature
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Jaakko Salli (jmsalli)
Assigned to: Nobody/Anonymous (nobody)
Summary: MSW Native wxBitmapComboBox
Initial Comment:
This patch contains native MSW implementation of wxBitmapComboBox.
Remarks
* Control inherits from wxComboBox, uses CBS_OWNERDRAWFIXED style.
* Control loses ability to display bitmap next to editable text field. However, since GTK native combo box widget can't do this either, I think it is a fair compromise.
* Added bmpcboxcmn.cpp, with lots of shared code used by both generic and MSW version.
----------------------------------------------------------------------
>Comment By: Jaakko Salli (jmsalli)
Date: 2008-05-01 18:27
Message:
Logged In: YES
user_id=1193883
Originator: YES
oneeyeman,
I'm a bit puzzled why msw/bmpcbox.cpp is included in wxUniv build, even
though I added it in section marked '<!-- not used with wxUniv -->' in
files.bkl.
Thanks,
Jaakko
----------------------------------------------------------------------
Comment By: ONEEYEMAN (oneeyeman)
Date: 2008-05-01 07:51
Message:
Logged In: YES
user_id=1325635
Originator: NO
Tried to compile on WSinXP using the project files with VC++6.
----------------------------------------------------------------------
Comment By: ONEEYEMAN (oneeyeman)
Date: 2008-05-01 07:50
Message:
Logged In: YES
user_id=1325635
Originator: NO
Jaakko,
I just applied the patch, but the library didn't compile cleanly:
--------------------Configuration: adv - Win32 DLL Universal
Release--------------------
Compiling...
bmpcbox.cpp
C:\wxWidgets\src\msw\bmpcbox.cpp(51) : error C2248: 'sm_eventTable' :
cannot access protected member declared in class 'wxGenericComboCtrl'
..\..\include\wx/generic/combo.h(93) : see declaration of
'sm_eventTable'
C:\wxWidgets\src\msw\bmpcbox.cpp(79) : error C2614: 'wxBitmapComboBox' :
illegal member initialization: 'wxComboBox' is not a base or member
C:\wxWidgets\src\msw\bmpcbox.cpp(112) : error C2352: 'wxComboBox::Create'
: illegal call of non-static member function
..\..\include\wx/univ/combobox.h(66) : see declaration of
'Create'
C:\wxWidgets\src\msw\bmpcbox.cpp(121) : error C2509: 'MSWGetStyle' :
member function not declared in 'wxBitmapComboBox'
..\..\include\wx/generic/bmpcbox.h(25) : see declaration of
'wxBitmapComboBox'
C:\wxWidgets\src\msw\bmpcbox.cpp(125) : error C2039: 'RecreateControl' :
is not a member of 'wxBitmapComboBox'
..\..\include\wx/generic/bmpcbox.h(25) : see declaration of
'wxBitmapComboBox'
C:\wxWidgets\src\msw\bmpcbox.cpp(126) : fatal error C1903: unable to
recover from previous error(s); stopping compilation
bmpcboxcmn.cpp
Generating Code...
Error executing cl.exe.
wxmswuniv290u_adv_vc_custom.dll - 6 error(s), 0 warning(s)
--------------------Configuration: xrc - Win32 DLL Universal
Release--------------------
Linking...
Creating library ..\..\lib\vc_dll\wxmswuniv29u_xrc.lib and object
..\..\lib\vc_dll\wxmswuniv29u_xrc.exp
xh_bmpcbox.obj : error LNK2001: unresolved external symbol "protected:
virtual int __thiscall wxBitmapComboBoxBase::DetermineIndent(void)"
(?DetermineIndent at wxBitmapComboBoxBase@@MAEHXZ)
xh_bmpcbox.obj : error LNK2001: unresolved external symbol "protected:
virtual bool __thiscall wxBitmapComboBoxBase::OnAddBitmap(class wxBitmap
const &)" (?OnAddBitmap at wxBitmapComboBoxBase@@MAE_NABVwxBitmap@@@Z)
xh_bmpcbox.obj : error LNK2001: unresolved external symbol "protected:
virtual class wxWindow * __thiscall wxBitmapComboBox::GetControl(void)"
(?GetControl at wxBitmapComboBox@@MAEPAVwxWindow@@XZ)
xh_bmpcbox.obj : error LNK2001: unresolved external symbol "protected:
virtual class wxItemContainer * __thiscall
wxBitmapComboBox::GetItemContainer(void)"
(?GetItemContainer at wxBitmapComboBox@@MAEPAVwxItemContainer@@XZ)
xh_bmpcbox.obj : error LNK2001: unresolved external symbol "public:
virtual class wxSize __thiscall
wxBitmapComboBoxBase::GetBitmapSize(void)const "
(?GetBitmapSize at wxBitmapComboBoxBase@@UBE?AVwxSize@@XZ)
xh_bmpcbox.obj : error LNK2001: unresolved external symbol "public:
virtual class wxBitmap __thiscall
wxBitmapComboBoxBase::GetItemBitmap(unsigned int)const "
(?GetItemBitmap at wxBitmapComboBoxBase@@UBE?AVwxBitmap@@I at Z)
xh_bmpcbox.obj : error LNK2001: unresolved external symbol "public:
virtual void __thiscall wxBitmapComboBox::SetItemBitmap(unsigned int,class
wxBitmap const &)" (?SetItemBitmap at wxBitmapComboBox@@UAEXIABVwxBitmap@@@Z)
xh_bmpcbox.obj : error LNK2001: unresolved external symbol "protected:
virtual void __thiscall wxBitmapComboBox::DoDeleteOneItem(unsigned int)"
(?DoDeleteOneItem at wxBitmapComboBox@@MAEXI at Z)
xh_bmpcbox.obj : error LNK2001: unresolved external symbol "protected:
virtual void __thiscall wxBitmapComboBox::DoClear(void)"
(?DoClear at wxBitmapComboBox@@MAEXXZ)
xh_bmpcbox.obj : error LNK2001: unresolved external symbol "protected:
virtual int __thiscall wxBitmapComboBox::DoInsertItems(class
wxArrayStringsAdapter const &,unsigned int,void * *,enum wxClientDataType)"
(?DoInsertItems at wxBitmapComboBox@@MAEHABV
wxArrayStringsAdapter@@IPAPAXW4wxClientDataType@@@Z)
xh_bmpcbox.obj : error LNK2001: unresolved external symbol "protected:
virtual void __thiscall wxBitmapComboBox::OnDrawBackground(class wxDC
&,class wxRect const &,int,int)const "
(?OnDrawBackground at wxBitmapComboBox@@MBEXAAVwxDC@@ABVwxRect@@HH at Z)
xh_bmpcbox.obj : error LNK2001: unresolved external symbol "protected:
virtual int __thiscall wxBitmapComboBox::OnMeasureItemWidth(unsigned
int)const " (?OnMeasureItemWidth at wxBitmapComboBox@@MBEHI at Z)
xh_bmpcbox.obj : error LNK2001: unresolved external symbol "protected:
virtual int __thiscall wxBitmapComboBox::OnMeasureItem(unsigned int)const "
(?OnMeasureItem at wxBitmapComboBox@@MBEHI at Z)
xh_bmpcbox.obj : error LNK2001: unresolved external symbol "protected:
virtual void __thiscall wxBitmapComboBox::OnDrawItem(class wxDC &,class
wxRect const &,int,int)const "
(?OnDrawItem at wxBitmapComboBox@@MBEXAAVwxDC@@ABVwxRect@@HH at Z)
xh_bmpcbox.obj : error LNK2001: unresolved external symbol "protected:
virtual class wxSize __thiscall wxBitmapComboBox::DoGetBestSize(void)const
" (?DoGetBestSize at wxBitmapComboBox@@MBE?AVwxSize@@XZ)
xh_bmpcbox.obj : error LNK2001: unresolved external symbol "protected:
virtual bool __thiscall wxBitmapComboBox::SetFont(class wxFont const &)"
(?SetFont at wxBitmapComboBox@@MAE_NABVwxFont@@@Z)
xh_bmpcbox.obj : error LNK2001: unresolved external symbol "protected:
virtual class wxEventHashTable & __thiscall
wxBitmapComboBox::GetEventHashTable(void)const "
(?GetEventHashTable at wxBitmapComboBox@@MBEAAVwxEventHashTable@@XZ)
xh_bmpcbox.obj : error LNK2001: unresolved external symbol "protected:
virtual struct wxEventTable const * __thiscall
wxBitmapComboBox::GetEventTable(void)const "
(?GetEventTable at wxBitmapComboBox@@MBEPBUwxEventTable@@XZ)
xh_bmpcbox.obj : error LNK2001: unresolved external symbol "public:
virtual class wxClassInfo * __thiscall
wxBitmapComboBox::GetClassInfo(void)const "
(?GetClassInfo at wxBitmapComboBox@@UBEPAVwxClassInfo@@XZ)
xh_bmpcbox.obj : error LNK2001: unresolved external symbol
"__declspec(dllimport) public: virtual __thiscall
wxBitmapComboBoxBase::~wxBitmapComboBoxBase(void)"
(__imp_??1wxBitmapComboBoxBase@@UAE at XZ)
xh_bmpcbox.obj : error LNK2001: unresolved external symbol
"__declspec(dllimport) public: bool __thiscall
wxBitmapComboBox::Create(class wxWindow *,int,class wxString const &,class
wxPoint const &,class wxSize const &,int,class wxString const * cons
t,long,class wxValidator const &,class wxString const &)"
(__imp_?Create at wxBitmapComboBox@@QAE_NPAVwxWindow@@HABVwxString@@ABVwxPoint@@ABVwxSize@@HQBV3 at JABVwxValidator@@1 at Z)
xh_bmpcbox.obj : error LNK2001: unresolved external symbol
"__declspec(dllimport) private: void __thiscall
wxBitmapComboBox::Init(void)" (__imp_?Init at wxBitmapComboBox@@AAEXXZ)
xh_bmpcbox.obj : error LNK2001: unresolved external symbol
"__declspec(dllimport) const wxBitmapComboBox::`vftable'{for
`wxBitmapComboBoxBase'}"
(__imp_??_7wxBitmapComboBox@@6BwxBitmapComboBoxBase@@@)
xh_bmpcbox.obj : error LNK2001: unresolved external symbol
"__declspec(dllimport) const wxBitmapComboBox::`vftable'{for
`wxOwnerDrawnComboBox'}"
(__imp_??_7wxBitmapComboBox@@6BwxOwnerDrawnComboBox@@@)
xh_bmpcbox.obj : error LNK2001: unresolved external symbol
"__declspec(dllimport) const wxBitmapComboBox::`vftable'{for
`wxInputConsumer'}" (__imp_??_7wxBitmapComboBox@@6BwxInputConsumer@@@)
xh_bmpcbox.obj : error LNK2001: unresolved external symbol
"__declspec(dllimport) const wxBitmapComboBox::`vftable'{for
`wxControlBase'}" (__imp_??_7wxBitmapComboBox@@6BwxControlBase@@@)
xh_bmpcbox.obj : error LNK2001: unresolved external symbol
"__declspec(dllimport) public: __thiscall
wxBitmapComboBoxBase::wxBitmapComboBoxBase(void)"
(__imp_??0wxBitmapComboBoxBase@@QAE at XZ)
xh_bmpcbox.obj : error LNK2001: unresolved external symbol
"__declspec(dllimport) public: int __thiscall
wxBitmapComboBox::Append(class wxString const &,class wxBitmap const &)"
(__imp_?Append at wxBitmapComboBox@@QAEHABVwxString@@ABVwxBitmap@@@Z)
xh_bmpcbox.obj : error LNK2001: unresolved external symbol
"__declspec(dllimport) public: virtual __thiscall
wxBitmapComboBox::~wxBitmapComboBox(void)"
(__imp_??1wxBitmapComboBox@@UAE at XZ)
..\..\lib\vc_dll\wxmswuniv290u_xrc_vc_custom.dll : fatal error LNK1120: 29
unresolved externals
Error executing link.exe.
wxmswuniv290u_xrc_vc_custom.dll - 30 error(s), 0 warning(s)
Also, there was the #if 1 code, that I guess left from the testing...
----------------------------------------------------------------------
Comment By: Jaakko Salli (jmsalli)
Date: 2008-04-22 21:44
Message:
Logged In: YES
user_id=1193883
Originator: YES
oneeyeman,
GTK combo box can display string and bitmap in list, and also in control
with wxCB_READONLY style. So it has pretty much the same capabilities as
MSW combo box except for the wxCB_SIMPLE support.
----------------------------------------------------------------------
Comment By: Robert Roebling (roebling)
Date: 2008-04-22 21:42
Message:
Logged In: YES
user_id=77100
Originator: NO
I misunderstood your initial description. I'm OK with your proposal.
----------------------------------------------------------------------
Comment By: ONEEYEMAN (oneeyeman)
Date: 2008-04-22 21:22
Message:
Logged In: YES
user_id=1325635
Originator: NO
Jaakko,
I don't know about Robert, but for me all you needed to say is that "I'm
talking about different combo box, and not the one you thinking..." ;-)
However, I wonder about GTK one. Is it the same as MSW? The thing is: GTK
does not have wxCB_SIMPLE style, so there it will just display and string
and bitmap will be shown in the list only, correct? Probably because you
have an ability to edit the text, so that it won't interfere with the new
text. But it should be equivalent to the color combo box on the same font
dialog...
----------------------------------------------------------------------
Comment By: Jaakko Salli (jmsalli)
Date: 2008-04-22 19:34
Message:
Logged In: YES
user_id=1193883
Originator: YES
oneeyeman,
Yes, I see, and originally saw the same thing, and wxBitmapComboBox in my
patch has capabilities of any combo box in that dialog.
I wonder why I have such trouble explaining this
"cannot-display-bitmap-next-to-editable-text-field" issue ;) Not only here
to you and Robert, but to others too. Maybe there is a better wording for
it...
Thanks,
Jaakko
----------------------------------------------------------------------
Comment By: ONEEYEMAN (oneeyeman)
Date: 2008-04-22 18:37
Message:
Logged In: YES
user_id=1325635
Originator: NO
Jaakko,
OK, just to clarify.
On the font dialog I have 3 wxCB_SIMPLE combo boxes to choose font name,
style and size. I also have a regular combo box to select color.
The color selection combo box is an owner-draw combo box. It shows the
small colored rectangle and it is read-only, meaning you can't type in it.
You can only select a letter and it chooses the string for you.
The font name combo box created as an owner drawn wxCB_SIMPLE combo box
and it has an ability to edit the font name. However, on the edit portion
of control I don't see the "O" symbol next to the font name. This symbol
displayed only in the list box portion.
I am almost sure this is not the case for older version of Windows that
has older DLL than me. But as I am working for US government we have to use
all latest patches from M$...
----------------------------------------------------------------------
Comment By: ONEEYEMAN (oneeyeman)
Date: 2008-04-22 18:27
Message:
Logged In: YES
user_id=1325635
Originator: NO
Jaakko,
At work I have:
WordPads version 5.1 on Windows XP Professional Version 2002 SP2.
But I guess all we really need is a DLL version and the date.
When viewing file c:\windows\system\commdlg.dll it says:
"File Version 3.1". Checking properties of this file reveals: "Created 02
Nov 2006, Modified: 04 Aug 2004".
Let me know if you want me to look in another file...
----------------------------------------------------------------------
Comment By: Jaakko Salli (jmsalli)
Date: 2008-04-22 18:11
Message:
Logged In: YES
user_id=1193883
Originator: YES
Robert,
Native GTK combo box (which I could implement as wxBitmapComboBox if this
patch goes through) can neither display bitmap next to text field, so I
thought it'd be actually better if control's features matched on both
platforms - even if this means that capabilities are slightly reduced.
Those who really need this bitmap-next-to-editable-field feature can still
use generic wxOwnerDrawnComboBox for this purpose (with some extra coding
effort of course).
Anyhow, on Windows, native COMBOBOXEX can actually display bitmaps next to
editable text field, but it has some problems, including: must re-implement
much of wxComboBox as it is a different control, doesn't work right with
wxCB_SIMPLE (according to docs). I think using it in wxBitmapComboBox
implementation would not be worth the effort, especially since generic
version works best on MSW anyway.
oneeyeman,
In my WordPad font dialog that color combo does not have editable text
field.
----------------------------------------------------------------------
Comment By: ONEEYEMAN (oneeyeman)
Date: 2008-04-21 23:59
Message:
Logged In: YES
user_id=1325635
Originator: NO
Robert,
It depends on the flag you supply to the control.
If you look at the font dialog on Windows, the actual font selection combo
the left topmost is a good example.
Also, there is a color choice combo box in the same dialog.
Jaakko,
I think you are wrong.
I just looked at the font dialog provided from WordPad->Format->Font...
The color combo box does display the little colored square in the text
box.
But when you choose wxCB_SIMPLE the bitmap is NOT present.
I'm on Windows XP with all latest updates to the system.
Also considering that GTK does not have wxCB_SIMPLE, as it MSW only, I
don't know what the native control behavior is.
Thank you.
----------------------------------------------------------------------
Comment By: Robert Roebling (roebling)
Date: 2008-04-21 23:49
Message:
Logged In: YES
user_id=77100
Originator: NO
I must be overlooking or misunderstanding something, but if the native
control either cannot edit text or doesn't display any bitmap, then it
shouldn't be called wxBitmapComboBox and should not replace the existing
control which can do that.
----------------------------------------------------------------------
Comment By: Jaakko Salli (jmsalli)
Date: 2008-04-21 21:59
Message:
Logged In: YES
user_id=1193883
Originator: YES
You can edit the text but there is no bitmap. Naturally, bitmap will still
appear in the control if window style wxCB_READONLY is used.
----------------------------------------------------------------------
Comment By: Robert Roebling (roebling)
Date: 2008-04-21 21:44
Message:
Logged In: YES
user_id=77100
Originator: NO
> Control loses ability to display bitmap next to editable
> text field.
Sorry, what can it not do? Can you still edit the text
but there is no bitmap or is there a bitmap and you
cannot edit the text?
----------------------------------------------------------------------
Comment By: ONEEYEMAN (oneeyeman)
Date: 2008-04-17 20:29
Message:
Logged In: YES
user_id=1325635
Originator: NO
1. OK.
2. I'll try your patch over the weekend and let you know. I simply can't
update the trunk tree right now. ;-)
----------------------------------------------------------------------
Comment By: Jaakko Salli (jmsalli)
Date: 2008-04-17 20:03
Message:
Logged In: YES
user_id=1193883
Originator: YES
1. Yes, I understood what you meant. What I meant however is that I had
thought devs do this themselves after patch has been committed (they'll let
me know if I'm wrong about this...). You can regenerate the needed files
yourself by running 'bakefile_gen' in build\bakefiles (bakefile 0.2.3
required).
2. No, because wxBitmapComboBox is already added in the "xrc" system.
AFAIK the one and same xrc-implementation works for all versions of
control, both native and generic. Please try it, and let me know if it
doesn't work.
----------------------------------------------------------------------
Comment By: ONEEYEMAN (oneeyeman)
Date: 2008-04-17 19:55
Message:
Logged In: YES
user_id=1325635
Originator: NO
Jaakko,
1. What I meant was that you need to update the .dsw/.dsp files for the
"adv" project. There are people who build the library using IDE.
2. DOn't you need to add it to the "xrc" system?
----------------------------------------------------------------------
Comment By: Jaakko Salli (jmsalli)
Date: 2008-04-17 19:36
Message:
Logged In: YES
user_id=1193883
Originator: YES
Hi,
1. I do not believe running bakefile is the responsibility of the patch
submitter (but if it is after all, devs will let me know ;).
2. Existing xrc system for generic wxBitmapComboBox should work.
----------------------------------------------------------------------
Comment By: ONEEYEMAN (oneeyeman)
Date: 2008-04-17 18:36
Message:
Logged In: YES
user_id=1325635
Originator: NO
Jaakko,
2 comments:
1. I don't know how the bakefiles and MSVC .dsp/.dsw system interacts, but
I think you need to update those 2 as well.
2. What about an xrc system?
Thank you.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=309863&aid=1941399&group_id=9863
More information about the wx-dev
mailing list