bool IsDragging() const { return m_is_dragging; }
protected:
+ // choose the default border for this window
+ virtual wxBorder GetDefaultBorder() const { return wxBORDER_NONE; }
void OnPaint(wxPaintEvent& evt);
void OnEraseBackground(wxEraseEvent& evt);
// virtual bool AcceptsFocus() const { return false; }
protected:
+ // choose the default border for this window
+ virtual wxBorder GetDefaultBorder() const { return wxBORDER_NONE; }
// these can be overridden
virtual void UpdateTabCtrlHeight();
SetSelection_SendEvent = 1
};
+ // choose the default border for this window
+ virtual wxBorder GetDefaultBorder() const { return wxBORDER_NONE; }
+
// set the selection to the given page, sending the events (which can
// possibly prevent the page change from taking place) if SendEvent flag is
// included
static wxSize GetDefaultSize();
protected:
+ // choose the default border for this window
+ virtual wxBorder GetDefaultBorder() const { return wxBORDER_NONE; }
+
DECLARE_NO_COPY_CLASS(wxButtonBase)
};
}
protected:
+ // choose the default border for this window
+ virtual wxBorder GetDefaultBorder() const { return wxBORDER_NONE; }
+
virtual void DoSet3StateValue(wxCheckBoxState WXUNUSED(state)) { wxFAIL; }
virtual wxCheckBoxState DoGet3StateValue() const
virtual void DoUpdateWindowUI(wxUpdateUIEvent& event);
protected:
+ // choose the default border for this window
+ virtual wxBorder GetDefaultBorder() const;
+
// creates the control (calls wxWindowBase::CreateBase inside) and adds it
// to the list of parents children
bool CreateControl(wxWindowBase *parent,
virtual bool AcceptsFocus() const { return false; }
protected:
+ virtual wxBorder GetDefaultBorder() const { return wxBORDER_NONE; }
+
// the max position
int m_rangeMax;
// wxWindow::Get/SetFont, wxWindow::Get/SetCursor are important !
protected:
+ virtual wxBorder GetDefaultBorder() const { return wxBORDER_NONE; }
+
// checks for validity some of the ctor/Create() function parameters
void CheckParams(const wxString& label, const wxString& url, long style);
virtual void Command(wxCommandEvent& event);
protected:
+ virtual wxBorder GetDefaultBorder() const { return wxBORDER_NONE; }
virtual wxSize DoGetBestSize() const;
private:
long style = 0,
const wxValidator& val = wxDefaultValidator,
const wxString &name = wxCheckBoxNameStr );
+
+protected:
+ virtual wxBorder GetDefaultBorder() const { return wxBORDER_NONE; }
+
private:
DECLARE_DYNAMIC_CLASS(wxToggleButton)
virtual bool CanApplyThemeBorder() const { return false; }
protected:
+ // choose the default border for this window
+ virtual wxBorder GetDefaultBorder() const { return wxBORDER_NONE; }
+
// common part of all ctors
void Init() { m_lastAcceptedSelection = wxID_NONE; }
virtual bool CanApplyThemeBorder() const { return false; }
protected:
+ virtual wxBorder GetDefaultBorder() const { return wxBORDER_NONE; }
virtual wxSize DoGetBestSize() const;
// the date currently shown by the control, may be invalid
virtual void DoMoveWindow(int x, int y, int width, int height);
virtual wxSize DoGetBestSize() const;
- virtual wxBorder GetDefaultBorder() const { return wxBORDER_NONE; }
-
-
// the labels windows, if any
wxSubwindows *m_labels;
virtual bool CanApplyThemeBorder() const { return false; }
protected:
- virtual wxBorder GetDefaultBorder() const;
virtual wxSize DoGetBestSize() const;
// ctor/dtor helpers
protected:
virtual wxSize DoGetBestSize() const;
- // choose the default border for this window
- virtual wxBorder GetDefaultBorder() const;
-
#ifndef __WXWINCE__
public:
virtual WXLRESULT MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam);
protected:
// implement/override some base class virtuals
- virtual wxBorder GetDefaultBorder() const;
virtual void DoSetSize(int x, int y, int w, int h,
int sizeFlags = wxSIZE_AUTO);
virtual wxSize DoGetBestSize() const;
virtual bool CanApplyThemeBorder() const { return false; }
protected:
+ virtual wxBorder GetDefaultBorder() const { return wxBORDER_NONE; }
virtual wxSize DoGetBestSize() const;
- virtual wxBorder GetDefaultBorder() const;
private:
DECLARE_DYNAMIC_CLASS_NO_COPY(wxToggleButton)
// choose the default border for this window
virtual wxBorder GetDefaultBorder() const;
+ // Translate wxBORDER_THEME (and other border styles if necessary to the value
+ // that makes most sense for this Windows environment
+ virtual wxBorder TranslateBorder(wxBorder border) const;
+
#if wxUSE_MENUS_NATIVE
virtual bool DoPopupMenu( wxMenu *menu, int x, int y );
#endif // wxUSE_MENUS_NATIVE
protected:
+ // choose the default border for this window
+ virtual wxBorder GetDefaultBorder() const { return wxBORDER_NONE; }
+
// adjust value according to wxSL_INVERSE style
virtual int ValueInvertOrNot(int value) const
{
virtual bool HasTransparentBackground() { return true; }
protected:
+ // choose the default border for this window
+ virtual wxBorder GetDefaultBorder() const { return wxBORDER_NONE; }
+
virtual wxSize DoGetBestSize() const;
DECLARE_NO_COPY_CLASS(wxStaticBitmapBase)
}
private:
+ // choose the default border for this window
+ virtual wxBorder GetDefaultBorder() const { return wxBORDER_NONE; }
+
DECLARE_NO_COPY_CLASS(wxStaticBoxBase)
};
virtual bool AcceptsFocus() const { return false; }
protected:
+ // choose the default border for this window
+ virtual wxBorder GetDefaultBorder() const { return wxBORDER_NONE; }
+
// set the right size for the right dimension
wxSize AdjustSize(const wxSize& size) const
{
protected: // functions required for wxST_ELLIPSIZE_* support
+ // choose the default border for this window
+ virtual wxBorder GetDefaultBorder() const { return wxBORDER_NONE; }
+
// just calls RemoveMarkup & Ellipsize on the original label.
virtual wxString GetEllipsizedLabelWithoutMarkup() const;
bool GetValue() const { return m_value; }
protected:
+ virtual wxBorder GetDefaultBorder() const { return wxBORDER_NONE; }
+
// the current value
bool m_value;
// area (normal windows can't, but e.g. menubar or statusbar can):
virtual bool CanBeOutsideClientArea() const { return false; }
- // returns true if the platform should explicitly apply a theme border
+ // returns true if the platform should explicitly apply a theme border. Currently
+ // used only by Windows
virtual bool CanApplyThemeBorder() const { return true; }
protected:
// this allows you to implement standard control borders without
// repeating the code in different classes that are not derived from
// wxControl
- virtual wxBorder GetDefaultBorderForControl() const { return wxBORDER_SUNKEN; }
+ virtual wxBorder GetDefaultBorderForControl() const { return wxBORDER_THEME; }
// Get the default size for the new window if no explicit size given. TLWs
// have their own default size so this is just for non top-level windows.
return wxStripMenuCodes(str, wxStrip_Mnemonics);
}
+wxBorder wxControlBase::GetDefaultBorder() const
+{
+ return wxBORDER_THEME;
+}
+
+
// ----------------------------------------------------------------------------
// wxStaticBitmap
// ----------------------------------------------------------------------------
wxBorder wxControl::GetDefaultBorder() const
{
- return GetDefaultBorderForControl();
+ return wxControlBase::GetDefaultBorder();
+
+// return GetDefaultBorderForControl();
}
// This is a helper for all wxControls made with UPDOWN native control.
return true;
}
-wxBorder wxStaticBitmap::GetDefaultBorder() const
-{
- return wxBORDER_NONE;
-}
-
WXDWORD wxStaticBitmap::MSWGetStyle(long style, WXDWORD *exstyle) const
{
WXDWORD msStyle = wxControl::MSWGetStyle(style, exstyle);
return true;
}
-wxBorder wxStaticBox::GetDefaultBorder() const
-{
- return wxBORDER_NONE;
-}
-
WXDWORD wxStaticBox::MSWGetStyle(long style, WXDWORD *exstyle) const
{
long styleWin = wxStaticBoxBase::MSWGetStyle(style, exstyle);
return true;
}
-wxBorder wxStaticText::GetDefaultBorder() const
-{
- return wxBORDER_NONE;
-}
-
WXDWORD wxStaticText::MSWGetStyle(long style, WXDWORD *exstyle) const
{
WXDWORD msStyle = wxControl::MSWGetStyle(style, exstyle);
if ( HasFlag(wxST_ELLIPSIZE_END) &&
wxGetOsVersion() == wxOS_WINDOWS_NT )
{
- // adding SS_ENDELLIPSIS or SS_ENDELLIPSIS "disables" the correct
- // newline handling in static texts: the newlines in the labels are
- // shown as square. Thus we don't use it even on newer OS when
+ // adding SS_ENDELLIPSIS or SS_ENDELLIPSIS "disables" the correct
+ // newline handling in static texts: the newlines in the labels are
+ // shown as square. Thus we don't use it even on newer OS when
// the static label contains a newline.
if ( label.Contains(wxT('\n')) )
styleReal &= ~SS_ENDELLIPSIS;
return true;
}
-wxBorder wxToggleButton::GetDefaultBorder() const
-{
- return wxBORDER_NONE;
-}
-
WXDWORD wxToggleButton::MSWGetStyle(long style, WXDWORD *exstyle) const
{
WXDWORD msStyle = wxControl::MSWGetStyle(style, exstyle);
wxBorder wxWindowMSW::GetDefaultBorder() const
{
- return GetDefaultBorderForControl();
+ // return GetDefaultBorderForControl();
+ return wxWindowBase::GetDefaultBorder();
}
+// Translate wxBORDER_THEME (and other border styles if necessary to the value
+// that makes most sense for this Windows environment
+wxBorder wxWindowMSW::TranslateBorder(wxBorder border) const
+{
+#if defined(__POCKETPC__) || defined(__SMARTPHONE__)
+ if (border == wxBORDER_THEME || border == wxBORDER_SUNKEN || border == wxBORDER_SIMPLE)
+ return wxBORDER_SIMPLE;
+ else
+ return wxBORDER_NONE;
+#else
+#if wxUSE_UXTHEME
+ if (border == wxBORDER_THEME)
+ {
+ if (CanApplyThemeBorder())
+ {
+ wxUxThemeEngine* theme = wxUxThemeEngine::GetIfActive();
+ if (theme)
+ return wxBORDER_THEME;
+ }
+ }
+#endif
+ return border;
+#endif
+
+ return border;
+}
+
+
WXDWORD wxWindowMSW::MSWGetStyle(long flags, WXDWORD *exstyle) const
{
// translate common wxWidgets styles to Windows ones
if ( flags & wxHSCROLL )
style |= WS_HSCROLL;
- const wxBorder border = GetBorder(flags);
+ const wxBorder border = TranslateBorder(GetBorder(flags));
+
+ // After translation, border is now optimized for the specific version of Windows
+ // and theme engine presence.
// WS_BORDER is only required for wxBORDER_SIMPLE
if ( border == wxBORDER_SIMPLE )
case WM_NCCALCSIZE:
{
wxUxThemeEngine* theme = wxUxThemeEngine::GetIfActive();
- if (theme && GetBorder() == wxBORDER_THEME)
+ const wxBorder border = TranslateBorder(GetBorder());
+ if (theme && border == wxBORDER_THEME)
{
// first ask the widget to calculate the border size
rc.result = MSWDefWindowProc(message, wParam, lParam);
case WM_NCPAINT:
{
wxUxThemeEngine* theme = wxUxThemeEngine::GetIfActive();
- if (theme && GetBorder() == wxBORDER_THEME)
+ const wxBorder border = TranslateBorder(GetBorder());
+ if (theme && border == wxBORDER_THEME)
{
// first ask the widget to paint its non-client area, such as scrollbars, etc.
rc.result = MSWDefWindowProc(message, wParam, lParam);