/[pcsx2_0.9.7]/branch/r3113_0.9.7_beta/3rdparty/wxWidgets/src/msw/combo.cpp
ViewVC logotype

Contents of /branch/r3113_0.9.7_beta/3rdparty/wxWidgets/src/msw/combo.cpp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 32 - (show annotations) (download)
Tue Sep 7 03:29:01 2010 UTC (9 years, 11 months ago) by william
File size: 20377 byte(s)
branching from upstream revision (http://pcsx2.googlecode.com/svn/trunk
): r3113 to
https://svn.netsolutions.dnsalias.com/websvn/ps2/pcsx2/pcsx2_0.9.7/branch/r3113_0.9.7_beta
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: src/msw/combo.cpp
3 // Purpose: wxMSW wxComboCtrl
4 // Author: Jaakko Salli
5 // Modified by:
6 // Created: Apr-30-2006
7 // RCS-ID: $Id: combo.cpp 48043 2007-08-13 11:13:03Z JS $
8 // Copyright: (c) 2005 Jaakko Salli
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
11
12 // ============================================================================
13 // declarations
14 // ============================================================================
15
16 // ----------------------------------------------------------------------------
17 // headers
18 // ----------------------------------------------------------------------------
19
20 #include "wx/wxprec.h"
21
22 #ifdef __BORLANDC__
23 #pragma hdrstop
24 #endif
25
26 #if wxUSE_COMBOCTRL
27
28 #ifndef WX_PRECOMP
29 #include "wx/log.h"
30 #include "wx/combobox.h"
31 #include "wx/dcclient.h"
32 #include "wx/settings.h"
33 #include "wx/dialog.h"
34 #include "wx/stopwatch.h"
35 #endif
36
37 #include "wx/dcbuffer.h"
38 #include "wx/combo.h"
39
40 #include "wx/msw/registry.h"
41
42 #if wxUSE_UXTHEME
43 #include "wx/msw/uxtheme.h"
44 #endif
45
46 // Change to #if 1 to include tmschema.h for easier testing of theme
47 // parameters.
48 #if 0
49 #include <tmschema.h>
50 #else
51 //----------------------------------
52 #define EP_EDITTEXT 1
53 #define ETS_NORMAL 1
54 #define ETS_HOT 2
55 #define ETS_SELECTED 3
56 #define ETS_DISABLED 4
57 #define ETS_FOCUSED 5
58 #define ETS_READONLY 6
59 #define ETS_ASSIST 7
60 #define TMT_FILLCOLOR 3802
61 #define TMT_TEXTCOLOR 3803
62 #define TMT_BORDERCOLOR 3801
63 #define TMT_EDGEFILLCOLOR 3808
64 //----------------------------------
65 #endif
66
67
68 #define NATIVE_TEXT_INDENT_XP 4
69 #define NATIVE_TEXT_INDENT_CLASSIC 2
70
71 #define TEXTCTRLXADJUST_XP 1
72 #define TEXTCTRLYADJUST_XP 3
73 #define TEXTCTRLXADJUST_CLASSIC 1
74 #define TEXTCTRLYADJUST_CLASSIC 2
75
76 #define COMBOBOX_ANIMATION_RESOLUTION 10
77
78 #define COMBOBOX_ANIMATION_DURATION 200 // In milliseconds
79
80 #define wxMSW_DESKTOP_USERPREFERENCESMASK_COMBOBOXANIM (1<<2)
81
82
83 // ============================================================================
84 // implementation
85 // ============================================================================
86
87
88 BEGIN_EVENT_TABLE(wxComboCtrl, wxComboCtrlBase)
89 EVT_PAINT(wxComboCtrl::OnPaintEvent)
90 EVT_MOUSE_EVENTS(wxComboCtrl::OnMouseEvent)
91 #if wxUSE_COMBOCTRL_POPUP_ANIMATION
92 EVT_TIMER(wxID_ANY, wxComboCtrl::OnTimerEvent)
93 #endif
94 END_EVENT_TABLE()
95
96
97 IMPLEMENT_DYNAMIC_CLASS(wxComboCtrl, wxComboCtrlBase)
98
99 void wxComboCtrl::Init()
100 {
101 }
102
103 bool wxComboCtrl::Create(wxWindow *parent,
104 wxWindowID id,
105 const wxString& value,
106 const wxPoint& pos,
107 const wxSize& size,
108 long style,
109 const wxValidator& validator,
110 const wxString& name)
111 {
112
113 // Set border
114 long border = style & wxBORDER_MASK;
115
116 #if wxUSE_UXTHEME
117 wxUxThemeEngine* theme = wxUxThemeEngine::GetIfActive();
118 #endif
119
120 if ( !border )
121 {
122 // For XP, have 1-width custom border, for older version use sunken
123 #if wxUSE_UXTHEME
124 if ( theme )
125 {
126 border = wxBORDER_NONE;
127 m_widthCustomBorder = 1;
128 }
129 else
130 #endif
131 border = wxBORDER_SUNKEN;
132
133 style = (style & ~(wxBORDER_MASK)) | border;
134 }
135
136 // create main window
137 if ( !wxComboCtrlBase::Create(parent,
138 id,
139 value,
140 pos,
141 size,
142 style | wxFULL_REPAINT_ON_RESIZE,
143 wxDefaultValidator,
144 name) )
145 return false;
146
147 if ( style & wxCC_STD_BUTTON )
148 m_iFlags |= wxCC_POPUP_ON_MOUSE_UP;
149
150 // Create textctrl, if necessary
151 CreateTextCtrl( wxNO_BORDER, validator );
152
153 // Add keyboard input handlers for main control and textctrl
154 InstallInputHandlers();
155
156 // Prepare background for double-buffering
157 SetBackgroundStyle( wxBG_STYLE_CUSTOM );
158
159 // SetInitialSize should be called last
160 SetInitialSize(size);
161
162 return true;
163 }
164
165 wxComboCtrl::~wxComboCtrl()
166 {
167 }
168
169 void wxComboCtrl::OnThemeChange()
170 {
171 // there doesn't seem to be any way to get the text colour using themes
172 // API: TMT_TEXTCOLOR doesn't work neither for EDIT nor COMBOBOX
173 SetForegroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT));
174
175 #if wxUSE_UXTHEME
176 wxUxThemeEngine * const theme = wxUxThemeEngine::GetIfActive();
177 if ( theme )
178 {
179 // NB: use EDIT, not COMBOBOX (the latter works in XP but not Vista)
180 wxUxThemeHandle hTheme(this, L"EDIT");
181 COLORREF col;
182 HRESULT hr = theme->GetThemeColor
183 (
184 hTheme,
185 EP_EDITTEXT,
186 ETS_NORMAL,
187 TMT_FILLCOLOR,
188 &col
189 );
190 if ( SUCCEEDED(hr) )
191 {
192 SetBackgroundColour(wxRGBToColour(col));
193
194 // skip the call below
195 return;
196 }
197
198 wxLogApiError(_T("GetThemeColor(EDIT, ETS_NORMAL, TMT_FILLCOLOR)"), hr);
199 }
200 #endif
201
202 SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW));
203 }
204
205 void wxComboCtrl::OnResize()
206 {
207 //
208 // Recalculates button and textctrl areas
209
210 int textCtrlXAdjust;
211 int textCtrlYAdjust;
212
213 #if wxUSE_UXTHEME
214 if ( wxUxThemeEngine::GetIfActive() )
215 {
216 textCtrlXAdjust = TEXTCTRLXADJUST_XP;
217 textCtrlYAdjust = TEXTCTRLYADJUST_XP;
218 }
219 else
220 #endif
221 {
222 textCtrlXAdjust = TEXTCTRLXADJUST_CLASSIC;
223 textCtrlYAdjust = TEXTCTRLYADJUST_CLASSIC;
224 }
225
226 // Technically Classic Windows style combo has more narrow button,
227 // but the native renderer doesn't paint it well like that.
228 int btnWidth = 17;
229 CalculateAreas(btnWidth);
230
231 // Position textctrl using standard routine
232 PositionTextCtrl(textCtrlXAdjust,textCtrlYAdjust);
233 }
234
235 // Draws non-XP GUI dotted line around the focus area
236 static void wxMSWDrawFocusRect( wxDC& dc, const wxRect& rect )
237 {
238 #if !defined(__WXWINCE__)
239 /*
240 RECT mswRect;
241 mswRect.left = rect.x;
242 mswRect.top = rect.y;
243 mswRect.right = rect.x + rect.width;
244 mswRect.bottom = rect.y + rect.height;
245 HDC hdc = (HDC) dc.GetHDC();
246 SetMapMode(hdc,MM_TEXT); // Just in case...
247 DrawFocusRect(hdc,&mswRect);
248 */
249 // FIXME: Use DrawFocusRect code above (currently it draws solid line
250 // for caption focus but works ok for other stuff).
251 // Also, this code below may not work in future wx versions, since
252 // it employs wxCAP_BUTT hack to have line of width 1.
253 dc.SetLogicalFunction(wxINVERT);
254
255 wxPen pen(*wxBLACK,1,wxDOT);
256 pen.SetCap(wxCAP_BUTT);
257 dc.SetPen(pen);
258 dc.SetBrush(*wxTRANSPARENT_BRUSH);
259
260 dc.DrawRectangle(rect);
261
262 dc.SetLogicalFunction(wxCOPY);
263 #else
264 dc.SetLogicalFunction(wxINVERT);
265
266 dc.SetPen(wxPen(*wxBLACK,1,wxDOT));
267 dc.SetBrush(*wxTRANSPARENT_BRUSH);
268
269 dc.DrawRectangle(rect);
270
271 dc.SetLogicalFunction(wxCOPY);
272 #endif
273 }
274
275 // draw focus background on area in a way typical on platform
276 void
277 wxComboCtrl::PrepareBackground( wxDC& dc, const wxRect& rect, int flags ) const
278 {
279 #if wxUSE_UXTHEME
280 wxUxThemeHandle hTheme(this, L"COMBOBOX");
281 #endif
282 //COLORREF cref;
283
284 wxSize sz = GetClientSize();
285 bool isEnabled;
286 bool isFocused; // also selected
287
288 // For smaller size control (and for disabled background) use less spacing
289 int focusSpacingX;
290 int focusSpacingY;
291
292 if ( !(flags & wxCONTROL_ISSUBMENU) )
293 {
294 // Drawing control
295 isEnabled = IsEnabled();
296 isFocused = ShouldDrawFocus();
297
298 #if wxUSE_UXTHEME
299 // Windows-style: for smaller size control (and for disabled background) use less spacing
300 if ( hTheme )
301 {
302 // WinXP Theme
303 focusSpacingX = isEnabled ? 2 : 1;
304 focusSpacingY = sz.y > (GetCharHeight()+2) && isEnabled ? 2 : 1;
305 }
306 else
307 #endif
308 {
309 // Classic Theme
310 if ( isEnabled )
311 {
312 focusSpacingX = 1;
313 focusSpacingY = 1;
314 }
315 else
316 {
317 focusSpacingX = 0;
318 focusSpacingY = 0;
319 }
320 }
321 }
322 else
323 {
324 // Drawing a list item
325 isEnabled = true; // they are never disabled
326 isFocused = flags & wxCONTROL_SELECTED ? true : false;
327
328 focusSpacingX = 0;
329 focusSpacingY = 0;
330 }
331
332 // Set the background sub-rectangle for selection, disabled etc
333 wxRect selRect(rect);
334 selRect.y += focusSpacingY;
335 selRect.height -= (focusSpacingY*2);
336
337 int wcp = 0;
338
339 if ( !(flags & wxCONTROL_ISSUBMENU) )
340 wcp += m_widthCustomPaint;
341
342 selRect.x += wcp + focusSpacingX;
343 selRect.width -= wcp + (focusSpacingX*2);
344
345 //wxUxThemeEngine* theme = (wxUxThemeEngine*) NULL;
346 //if ( hTheme )
347 // theme = wxUxThemeEngine::GetIfActive();
348
349 wxColour bgCol;
350 bool drawDottedEdge = false;
351
352 if ( isEnabled )
353 {
354 // If popup is hidden and this control is focused,
355 // then draw the focus-indicator (selbgcolor background etc.).
356 if ( isFocused )
357 {
358 #if 0
359 // TODO: Proper theme color getting (JMS: I don't know which parts/colors to use,
360 // those below don't work)
361 if ( hTheme )
362 {
363 theme->GetThemeColor(hTheme,EP_EDITTEXT,ETS_SELECTED,TMT_TEXTCOLOR,&cref);
364 dc.SetTextForeground( wxRGBToColour(cref) );
365 theme->GetThemeColor(hTheme,EP_EDITTEXT,ETS_SELECTED,TMT_FILLCOLOR,&cref);
366 bgCol = wxRGBToColour(cref);
367 }
368 else
369 #endif
370 {
371 dc.SetTextForeground( wxSystemSettings::GetColour(wxSYS_COLOUR_HIGHLIGHTTEXT) );
372 bgCol = wxSystemSettings::GetColour(wxSYS_COLOUR_HIGHLIGHT);
373 if ( m_windowStyle & wxCB_READONLY )
374 drawDottedEdge = true;
375 }
376 }
377 else
378 {
379 /*if ( hTheme )
380 {
381 theme->GetThemeColor(hTheme,EP_EDITTEXT,ETS_NORMAL,TMT_TEXTCOLOR,&cref);
382 dc.SetTextForeground( wxRGBToColour(cref) );
383 theme->GetThemeColor(hTheme,EP_EDITTEXT,ETS_NORMAL,TMT_FILLCOLOR,&cref);
384 bgCol = wxRGBToColour(cref);
385 }
386 else
387 {*/
388 dc.SetTextForeground( wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT) );
389 bgCol = GetBackgroundColour();
390 //}
391 }
392 }
393 else
394 {
395 /*if ( hTheme )
396 {
397 theme->GetThemeColor(hTheme,EP_EDITTEXT,ETS_DISABLED,TMT_TEXTCOLOR,&cref);
398 dc.SetTextForeground( wxRGBToColour(cref) );
399 theme->GetThemeColor(hTheme,EP_EDITTEXT,ETS_DISABLED,TMT_EDGEFILLCOLOR,&cref);
400 bgCol = wxRGBToColour(cref);
401 }
402 else
403 {*/
404 dc.SetTextForeground( wxSystemSettings::GetColour(wxSYS_COLOUR_GRAYTEXT) );
405 bgCol = wxSystemSettings::GetColour(wxSYS_COLOUR_BTNFACE);
406 //}
407 }
408
409 dc.SetBrush(bgCol);
410 dc.SetPen(bgCol);
411 dc.DrawRectangle(selRect);
412 if ( drawDottedEdge )
413 wxMSWDrawFocusRect(dc,selRect);
414
415 // Don't clip exactly to the selection rectangle so we can draw
416 // to the non-selected area in front of it.
417 wxRect clipRect(rect.x,rect.y,
418 (selRect.x+selRect.width)-rect.x-1,rect.height);
419 dc.SetClippingRegion(clipRect);
420 }
421
422 void wxComboCtrl::OnPaintEvent( wxPaintEvent& WXUNUSED(event) )
423 {
424 // TODO: Convert drawing in this function to Windows API Code
425
426 wxSize sz = GetClientSize();
427 wxAutoBufferedPaintDC dc(this);
428
429 const wxRect& rectb = m_btnArea;
430 wxRect rect = m_tcArea;
431 bool isEnabled = IsEnabled();
432 wxColour bgCol = GetBackgroundColour();
433 wxColour fgCol;
434
435 #if wxUSE_UXTHEME
436 wxUxThemeEngine* theme = NULL;
437 wxUxThemeHandle hTheme(this, L"COMBOBOX");
438 #endif
439
440 int etsState;
441
442 // area around both controls
443 wxRect rect2(0,0,sz.x,sz.y);
444 if ( m_iFlags & wxCC_IFLAG_BUTTON_OUTSIDE )
445 {
446 rect2 = m_tcArea;
447 rect2.Inflate(1);
448 }
449
450 #if wxUSE_UXTHEME
451 // Use theme to draw border on XP
452 if ( hTheme )
453 {
454 theme = wxUxThemeEngine::GetIfActive();
455 COLORREF cref;
456
457 // Select correct border colour
458 if ( !isEnabled )
459 etsState = ETS_DISABLED;
460 else
461 etsState = ETS_NORMAL;
462
463 if ( m_widthCustomBorder )
464 {
465 theme->GetThemeColor(hTheme,EP_EDITTEXT,etsState,TMT_BORDERCOLOR,&cref);
466
467 // Set border colour
468 dc.SetPen( wxRGBToColour(cref) );
469
470 dc.SetBrush( *wxTRANSPARENT_BRUSH );
471 dc.DrawRectangle(rect2);
472 }
473
474 theme->GetThemeColor(hTheme,EP_EDITTEXT,etsState,TMT_TEXTCOLOR,&cref);
475 fgCol = wxRGBToColour(cref);
476 }
477 else
478 #endif
479 {
480 // draw regular background
481 fgCol = GetForegroundColour();
482 }
483
484 rect2.Deflate(m_widthCustomBorder);
485
486 dc.SetBrush(bgCol);
487 dc.SetPen(bgCol);
488
489 // clear main background
490 dc.DrawRectangle(rect);
491
492 // Button background with theme?
493 int drawButFlags = Draw_PaintBg;
494 #if wxUSE_UXTHEME
495 if ( hTheme && m_blankButtonBg )
496 {
497 RECT r;
498 wxCopyRectToRECT(rectb, r);
499
500 // Draw parent background if needed (since button looks like its out of
501 // the combo, this is preferred).
502 theme->DrawThemeParentBackground(GetHwndOf(this),
503 GetHdcOf(dc),
504 &r);
505
506 drawButFlags = 0;
507 }
508 #endif
509
510 // Standard button rendering
511 DrawButton(dc,rectb,drawButFlags);
512
513 // paint required portion on the control
514 if ( (!m_text || m_widthCustomPaint) )
515 {
516 wxASSERT( m_widthCustomPaint >= 0 );
517
518 // this is intentionally here to allow drawed rectangle's
519 // right edge to be hidden
520 if ( m_text )
521 rect.width = m_widthCustomPaint;
522
523 dc.SetFont( GetFont() );
524
525 dc.SetClippingRegion(rect);
526 if ( m_popupInterface )
527 m_popupInterface->PaintComboControl(dc,rect);
528 else
529 wxComboPopup::DefaultPaintComboControl(this,dc,rect);
530 }
531 }
532
533 void wxComboCtrl::OnMouseEvent( wxMouseEvent& event )
534 {
535 int mx = event.m_x;
536 bool isOnButtonArea = m_btnArea.Contains(mx,event.m_y);
537 int handlerFlags = isOnButtonArea ? wxCC_MF_ON_BUTTON : 0;
538
539 if ( PreprocessMouseEvent(event,isOnButtonArea) )
540 return;
541
542 if ( (m_windowStyle & (wxCC_SPECIAL_DCLICK|wxCB_READONLY)) == wxCB_READONLY )
543 {
544 // if no textctrl and no special double-click, then the entire control acts
545 // as a button
546 handlerFlags |= wxCC_MF_ON_BUTTON;
547 if ( HandleButtonMouseEvent(event,handlerFlags) )
548 return;
549 }
550 else
551 {
552 if ( isOnButtonArea || HasCapture() ||
553 (m_widthCustomPaint && mx < (m_tcArea.x+m_widthCustomPaint)) )
554 {
555 handlerFlags |= wxCC_MF_ON_CLICK_AREA;
556
557 if ( HandleButtonMouseEvent(event,handlerFlags) )
558 return;
559 }
560 else if ( m_btnState )
561 {
562 // otherwise need to clear the hover status
563 m_btnState = 0;
564 RefreshRect(m_btnArea);
565 }
566 }
567
568 //
569 // This will handle left_down and left_dclick events outside button in a Windows-like manner.
570 // See header file for further information on this method.
571 HandleNormalMouseEvent(event);
572
573 }
574
575 #if wxUSE_COMBOCTRL_POPUP_ANIMATION
576 static wxUint32 GetUserPreferencesMask()
577 {
578 static wxUint32 userPreferencesMask = 0;
579 static bool valueSet = false;
580
581 if ( valueSet )
582 return userPreferencesMask;
583
584 wxRegKey* pKey = NULL;
585 wxRegKey key1(wxRegKey::HKCU, wxT("Software\\Policies\\Microsoft\\Control Panel"));
586 wxRegKey key2(wxRegKey::HKCU, wxT("Software\\Policies\\Microsoft\\Windows\\Control Panel"));
587 wxRegKey key3(wxRegKey::HKCU, wxT("Control Panel\\Desktop"));
588
589 if ( key1.Exists() )
590 pKey = &key1;
591 else if ( key2.Exists() )
592 pKey = &key2;
593 else if ( key3.Exists() )
594 pKey = &key3;
595
596 if ( pKey && pKey->Open(wxRegKey::Read) )
597 {
598 wxMemoryBuffer buf;
599 if ( pKey->HasValue(wxT("UserPreferencesMask")) &&
600 pKey->QueryValue(wxT("UserPreferencesMask"), buf) )
601 {
602 if ( buf.GetDataLen() >= 4 )
603 {
604 wxUint32* p = (wxUint32*) buf.GetData();
605 userPreferencesMask = *p;
606 }
607 }
608 }
609
610 valueSet = true;
611
612 return userPreferencesMask;
613 }
614 #endif
615
616 #if wxUSE_COMBOCTRL_POPUP_ANIMATION
617 void wxComboCtrl::OnTimerEvent( wxTimerEvent& WXUNUSED(event) )
618 {
619 bool stopTimer = false;
620
621 wxWindow* popup = GetPopupControl()->GetControl();
622
623 // Popup was hidden before it was fully shown?
624 if ( IsPopupWindowState(Hidden) )
625 {
626 stopTimer = true;
627 }
628 else
629 {
630 wxLongLong t = ::wxGetLocalTimeMillis();
631 const wxRect& rect = m_animRect;
632 wxWindow* win = GetPopupWindow();
633
634 int pos = (int) (t-m_animStart).GetLo();
635 if ( pos < COMBOBOX_ANIMATION_DURATION )
636 {
637 int height = rect.height;
638 //int h0 = rect.height;
639 int h = (((pos*256)/COMBOBOX_ANIMATION_DURATION)*height)/256;
640 int y = (height - h);
641 if ( y < 0 )
642 y = 0;
643
644 if ( m_animFlags & ShowAbove )
645 {
646 win->SetSize( rect.x, rect.y + height - h, rect.width, h );
647 }
648 else
649 {
650 popup->Move( 0, -y );
651 win->SetSize( rect.x, rect.y, rect.width, h );
652 }
653 }
654 else
655 {
656 stopTimer = true;
657 }
658 }
659
660 if ( stopTimer )
661 {
662 popup->Move( 0, 0 );
663 m_animTimer.Stop();
664 DoShowPopup( m_animRect, m_animFlags );
665 }
666 }
667 #endif
668
669 #if wxUSE_COMBOCTRL_POPUP_ANIMATION
670 bool wxComboCtrl::AnimateShow( const wxRect& rect, int flags )
671 {
672 if ( GetUserPreferencesMask() & wxMSW_DESKTOP_USERPREFERENCESMASK_COMBOBOXANIM )
673 {
674 m_animStart = ::wxGetLocalTimeMillis();
675 m_animRect = rect;
676 m_animFlags = flags;
677
678 wxWindow* win = GetPopupWindow();
679 win->SetSize( rect.x, rect.y, rect.width, 0 );
680 win->Show();
681
682 m_animTimer.SetOwner( this, wxID_ANY );
683 m_animTimer.Start( COMBOBOX_ANIMATION_RESOLUTION, wxTIMER_CONTINUOUS );
684
685 OnTimerEvent(*((wxTimerEvent*)NULL)); // Event is never used, so we can give NULL
686
687 return false;
688 }
689
690 return true;
691 }
692 #endif
693
694 wxCoord wxComboCtrl::GetNativeTextIndent() const
695 {
696 #if wxUSE_UXTHEME
697 if ( wxUxThemeEngine::GetIfActive() )
698 return NATIVE_TEXT_INDENT_XP;
699 #endif
700 return NATIVE_TEXT_INDENT_CLASSIC;
701 }
702
703 bool wxComboCtrl::IsKeyPopupToggle(const wxKeyEvent& event) const
704 {
705 const bool isPopupShown = IsPopupShown();
706
707 switch ( event.GetKeyCode() )
708 {
709 case WXK_F4:
710 // F4 toggles the popup in the native comboboxes, so emulate them
711 if ( !event.AltDown() )
712 return true;
713 break;
714
715 case WXK_ESCAPE:
716 if ( isPopupShown )
717 return true;
718 break;
719
720 case WXK_DOWN:
721 case WXK_UP:
722 // On XP or with writable combo in Classic, arrows don't open the
723 // popup but Alt-arrow does
724 if ( event.AltDown() ||
725 ( !isPopupShown &&
726 HasFlag(wxCB_READONLY)
727 #if wxUSE_UXTHEME
728 &&
729 !wxUxThemeEngine::GetIfActive()
730 #endif
731 ) )
732 {
733 return true;
734 }
735 break;
736 }
737
738 return false;
739 }
740
741 #endif // wxUSE_COMBOCTRL

  ViewVC Help
Powered by ViewVC 1.1.22