- SetName(name);
- SetValidator(validator);
- if (parent) parent->AddChild(this);
- SetBackgroundColour(parent->GetBackgroundColour()) ;
- SetForegroundColour(parent->GetForegroundColour()) ;
-
- m_windowStyle = style;
-
- if ( id == -1 )
- m_windowId = (int)NewControlId();
- else
- m_windowId = id;
-
- int x = pos.x;
- int y = pos.y;
- int width = size.x;
- int height = size.y;
-// TODO:
-/*
- long msStyle = WS_CHILD | WS_TABSTOP | WS_VISIBLE | WS_HSCROLL | WS_VSCROLL |
- CBS_NOINTEGRALHEIGHT;
-
- if (m_windowStyle & wxCB_READONLY)
- msStyle |= CBS_DROPDOWNLIST;
- else if (m_windowStyle & wxCB_SIMPLE)
- msStyle |= CBS_SIMPLE; // A list (shown always) and edit control
- else
- msStyle |= CBS_DROPDOWN;
-
- if (m_windowStyle & wxCB_SORT)
- msStyle |= CBS_SORT;
-
- bool want3D;
- WXDWORD exStyle = Determine3DEffects(WS_EX_CLIENTEDGE, &want3D) ;
-
- // Even with extended styles, need to combine with WS_BORDER
- // for them to look right.
- if ( want3D || wxStyleHasBorder(m_windowStyle) )
- msStyle |= WS_BORDER;
-
- m_hWnd = (WXHWND)::CreateWindowEx(exStyle, wxT("COMBOBOX"), NULL,
- msStyle,
- 0, 0, 0, 0, (HWND) parent->GetHWND(), (HMENU)m_windowId,
- wxGetInstance(), NULL);
-
- wxCHECK_MSG( m_hWnd, FALSE, wxT("Failed to create combobox") );
-
- // Subclass again for purposes of dialog editing mode
- SubclassWin(m_hWnd);
-
- SetFont(parent->GetFont());
- int i;
- for (i = 0; i < n; i++)
- {
- Append(choices[i]);
- }
-
- SetSelection(i);
-
- SetSize(x, y, width, height);
- if ( !value.IsEmpty() )
- {
- SetValue(value);
- }
-*/
- return TRUE;
-}
+ m_isShown = FALSE;
+
+ if (!CreateControl( pParent
+ ,vId
+ ,rPos
+ ,rSize
+ ,lStyle
+ ,rValidator
+ ,rsName
+ ))
+ return FALSE;
+
+ //
+ // Get the right style
+ //
+ long lSstyle = 0L;
+
+ lSstyle = WS_TABSTOP |
+ WS_VISIBLE;
+
+ if (lStyle & wxCLIP_SIBLINGS )
+ lSstyle |= WS_CLIPSIBLINGS;
+ if (lStyle & wxCB_READONLY)
+ lSstyle |= CBS_DROPDOWNLIST;
+ else if (lStyle & wxCB_SIMPLE)
+ lSstyle |= CBS_SIMPLE; // A list (shown always) and edit control
+ else
+ lSstyle |= CBS_DROPDOWN;
+
+
+ if (!OS2CreateControl( "COMBOBOX"
+ ,lSstyle
+ ))
+ return FALSE;
+
+ //
+ // A choice/combobox normally has a white background (or other, depending
+ // on global settings) rather than inheriting the parent's background colour.
+ //
+ SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW));
+
+ SetFont(*wxSMALL_FONT);
+
+ int i;
+ for (i = 0; i < n; i++)
+ {
+ Append(asChoices[i]);
+ }