1. added wxStatusBarUniv
2. several bug fixes to wxSpinButton/wxSpinCtrl git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@11991 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -10,24 +10,24 @@
|
|||||||
# BaseOnly /src/common but only needed for the wxBase compilation
|
# BaseOnly /src/common but only needed for the wxBase compilation
|
||||||
# Generic /src/generic
|
# Generic /src/generic
|
||||||
# Common /src/common
|
# Common /src/common
|
||||||
# MSW /src/msw
|
# MSW /src/msw
|
||||||
# Mac /src/mac for Mac OS X with Apple Developer Tools
|
# Mac /src/mac for Mac OS X with Apple Developer Tools
|
||||||
# Motif /src/motif
|
# Motif /src/motif
|
||||||
# Univ /src/univ or src/univ/themes
|
# Univ /src/univ or src/univ/themes
|
||||||
# Unix /src/unix
|
# Unix /src/unix
|
||||||
# GTK /src/gtk
|
# GTK /src/gtk
|
||||||
# MGL /src/mgl
|
# MGL /src/mgl
|
||||||
# OS2 /src/os2
|
# OS2 /src/os2
|
||||||
# HTML /src/html
|
# HTML /src/html
|
||||||
#
|
#
|
||||||
# 'H' suffix means these are headers, not .cpp files
|
# 'H' suffix means these are headers, not .cpp files
|
||||||
#
|
#
|
||||||
# WXH /include/wx
|
# WXH /include/wx
|
||||||
# GTKH /include/wx/gtk
|
# GTKH /include/wx/gtk
|
||||||
# MacH /include/wx/mac
|
# MacH /include/wx/mac
|
||||||
# MotifH /include/wx/motif
|
# MotifH /include/wx/motif
|
||||||
# MSWH /include/wx/msw
|
# MSWH /include/wx/msw
|
||||||
# OS2H /include/wx/os2
|
# OS2H /include/wx/os2
|
||||||
# GenericH /include/wx/generic
|
# GenericH /include/wx/generic
|
||||||
# HtmlH /include/wx/html
|
# HtmlH /include/wx/html
|
||||||
# ProtoH /include/wx/protocol
|
# ProtoH /include/wx/protocol
|
||||||
@@ -36,27 +36,28 @@
|
|||||||
#
|
#
|
||||||
# 'R' suffix means these are resource files
|
# 'R' suffix means these are resource files
|
||||||
#
|
#
|
||||||
# MacR /src/mac
|
# MacR /src/mac
|
||||||
#
|
#
|
||||||
# The third column may be empty or contain some additional info about this
|
# The third column may be empty or contain some additional info about this
|
||||||
# file (only compile it in 16bit mode, don't compile it with this or that
|
# file (only compile it in 16bit mode, don't compile it with this or that
|
||||||
# compiler, &c)
|
# compiler, &c)
|
||||||
#
|
#
|
||||||
# Known flags:
|
# Known flags:
|
||||||
# Base makes part of the base library too
|
# Base makes part of the base library too
|
||||||
# NotWin32 not used under Win32, but used under Win16
|
# NotWin32 not used under Win32, but used under Win16
|
||||||
# Win32Only only can be compiled under Win32
|
# Win32Only only can be compiled under Win32
|
||||||
# Generic generic code which might be used instead of native one
|
# Generic generic code which might be used instead of native one
|
||||||
# OLE OLE file (needs Win32 and a decent compiler)
|
# OLE OLE file (needs Win32 and a decent compiler)
|
||||||
# Socket Socket file (currently doesn't compile under Win16)
|
# Socket Socket file (currently doesn't compile under Win16)
|
||||||
# NotMSW Not required for the MSW port
|
# NotMSW Not required for the MSW port
|
||||||
# NotMac Not required for the MAC port under Mac OS X
|
# NotMac Not required for the MAC port under Mac OS X
|
||||||
# NotMGL Not required for the MGL port
|
# NotMGL Not required for the MGL port
|
||||||
# NotGTK Not required for the GTK port
|
# NotGTK Not required for the GTK port
|
||||||
# NotX Not required for the Motif port
|
# NotX Not required for the Motif port
|
||||||
# NotOS2 Not required for the os2Pm port
|
# NotOS2 Not required for the os2Pm port
|
||||||
|
# NotUniv Not required for the wxUniversal
|
||||||
# LowLevel Low level GUI toolkit file, used by wxUniversal as well
|
# LowLevel Low level GUI toolkit file, used by wxUniversal as well
|
||||||
# Theme implements a wxUniv theme
|
# Theme implements a wxUniv theme
|
||||||
###############################################################################
|
###############################################################################
|
||||||
|
|
||||||
# File name Type Flags
|
# File name Type Flags
|
||||||
@@ -207,6 +208,7 @@ sckstrm.cpp Common Socket,Base
|
|||||||
serbase.cpp Common Base
|
serbase.cpp Common Base
|
||||||
sizer.cpp Common
|
sizer.cpp Common
|
||||||
socket.cpp Common Socket,Base
|
socket.cpp Common Socket,Base
|
||||||
|
statbar.cpp Common
|
||||||
strconv.cpp Common Base
|
strconv.cpp Common Base
|
||||||
stream.cpp Common Base
|
stream.cpp Common Base
|
||||||
string.cpp Common Base
|
string.cpp Common Base
|
||||||
@@ -383,6 +385,7 @@ statbmp.cpp Univ
|
|||||||
statbox.cpp Univ
|
statbox.cpp Univ
|
||||||
statline.cpp Univ
|
statline.cpp Univ
|
||||||
stattext.cpp Univ
|
stattext.cpp Univ
|
||||||
|
statusbr.cpp Univ
|
||||||
textctrl.cpp Univ
|
textctrl.cpp Univ
|
||||||
theme.cpp Univ
|
theme.cpp Univ
|
||||||
gtk.cpp Univ Theme
|
gtk.cpp Univ Theme
|
||||||
@@ -1410,6 +1413,7 @@ statbmp.h UnivH
|
|||||||
statbox.h UnivH
|
statbox.h UnivH
|
||||||
statline.h UnivH
|
statline.h UnivH
|
||||||
stattext.h UnivH
|
stattext.h UnivH
|
||||||
|
statusbr.h UnivH
|
||||||
textctrl.h UnivH
|
textctrl.h UnivH
|
||||||
theme.h UnivH
|
theme.h UnivH
|
||||||
window.h UnivH
|
window.h UnivH
|
||||||
|
@@ -135,68 +135,71 @@ The status field string if the field is valid, otherwise the empty string.
|
|||||||
|
|
||||||
\helpref{wxStatusBar::SetStatusText}{wxstatusbarsetstatustext}
|
\helpref{wxStatusBar::SetStatusText}{wxstatusbarsetstatustext}
|
||||||
|
|
||||||
\membersection{wxStatusBar::DrawField}\label{wxstatusbardrawfield}
|
%% VZ: these functions are not in wxStatusBar API, these are just
|
||||||
|
%% implementation details of wxStatusBarGeneric
|
||||||
\func{virtual void}{DrawField}{\param{wxDC\& }{dc}, \param{int }{i}}
|
%%
|
||||||
|
%% \membersection{wxStatusBar::DrawField}\label{wxstatusbardrawfield}
|
||||||
Draws a field, including shaded borders and text.
|
%%
|
||||||
|
%% \func{virtual void}{DrawField}{\param{wxDC\& }{dc}, \param{int }{i}}
|
||||||
\wxheading{Parameters}
|
%%
|
||||||
|
%% Draws a field, including shaded borders and text.
|
||||||
\docparam{dc}{The device context to draw onto.}
|
%%
|
||||||
|
%% \wxheading{Parameters}
|
||||||
\docparam{i}{The field to be drawn.}
|
%%
|
||||||
|
%% \docparam{dc}{The device context to draw onto.}
|
||||||
\wxheading{See also}
|
%%
|
||||||
|
%% \docparam{i}{The field to be drawn.}
|
||||||
\helpref{wxStatusBar::DrawFieldText}{wxstatusbardrawfieldtext}
|
%%
|
||||||
|
%% \wxheading{See also}
|
||||||
\membersection{wxStatusBar::DrawFieldText}\label{wxstatusbardrawfieldtext}
|
%%
|
||||||
|
%% \helpref{wxStatusBar::DrawFieldText}{wxstatusbardrawfieldtext}
|
||||||
\func{virtual void}{DrawFieldText}{\param{wxDC\& }{dc}, \param{int }{i}}
|
%%
|
||||||
|
%% \membersection{wxStatusBar::DrawFieldText}\label{wxstatusbardrawfieldtext}
|
||||||
Draws a field's text.
|
%%
|
||||||
|
%% \func{virtual void}{DrawFieldText}{\param{wxDC\& }{dc}, \param{int }{i}}
|
||||||
\wxheading{Parameters}
|
%%
|
||||||
|
%% Draws a field's text.
|
||||||
\docparam{dc}{The device context to draw onto.}
|
%%
|
||||||
|
%% \wxheading{Parameters}
|
||||||
\docparam{i}{The field whose text is to be drawn.}
|
%%
|
||||||
|
%% \docparam{dc}{The device context to draw onto.}
|
||||||
\wxheading{See also}
|
%%
|
||||||
|
%% \docparam{i}{The field whose text is to be drawn.}
|
||||||
\helpref{wxStatusBar::DrawField}{wxstatusbardrawfield}
|
%%
|
||||||
|
%% \wxheading{See also}
|
||||||
\membersection{wxStatusBar::InitColours}\label{wxstatusbarinitcolours}
|
%%
|
||||||
|
%% \helpref{wxStatusBar::DrawField}{wxstatusbardrawfield}
|
||||||
\func{virtual void}{InitColours}{\void}
|
%%
|
||||||
|
%% \membersection{wxStatusBar::InitColours}\label{wxstatusbarinitcolours}
|
||||||
Sets up the background colour and shading pens using suitable system colours (Windows) or tasteful shades
|
%%
|
||||||
of grey (other platforms).
|
%% \func{virtual void}{InitColours}{\void}
|
||||||
|
%%
|
||||||
\wxheading{Remarks}
|
%% Sets up the background colour and shading pens using suitable system colours (Windows) or tasteful shades
|
||||||
|
%% of grey (other platforms).
|
||||||
This function is called when the window is created, and also
|
%%
|
||||||
from \helpref{wxStatusBar::OnSysColourChanged}{wxstatusbaronsyscolourchanged} on Windows.
|
%% \wxheading{Remarks}
|
||||||
|
%%
|
||||||
\wxheading{See also}
|
%% This function is called when the window is created, and also
|
||||||
|
%% from \helpref{wxStatusBar::OnSysColourChanged}{wxstatusbaronsyscolourchanged} on Windows.
|
||||||
\helpref{wxStatusBar::OnSysColourChanged}{wxstatusbaronsyscolourchanged}
|
%%
|
||||||
|
%% \wxheading{See also}
|
||||||
\membersection{wxStatusBar::OnSysColourChanged}\label{wxstatusbaronsyscolourchanged}
|
%%
|
||||||
|
%% \helpref{wxStatusBar::OnSysColourChanged}{wxstatusbaronsyscolourchanged}
|
||||||
\func{void}{OnSysColourChanged}{\param{wxSysColourChangedEvent\& }{event}}
|
%%
|
||||||
|
%% \membersection{wxStatusBar::OnSysColourChanged}\label{wxstatusbaronsyscolourchanged}
|
||||||
Handles a system colour change by calling \helpref{wxStatusBar::InitColours}{wxstatusbarinitcolours},
|
%%
|
||||||
and refreshes the window.
|
%% \func{void}{OnSysColourChanged}{\param{wxSysColourChangedEvent\& }{event}}
|
||||||
|
%%
|
||||||
\wxheading{Parameters}
|
%% Handles a system colour change by calling \helpref{wxStatusBar::InitColours}{wxstatusbarinitcolours},
|
||||||
|
%% and refreshes the window.
|
||||||
\docparam{event}{The colour change event.}
|
%%
|
||||||
|
%% \wxheading{Parameters}
|
||||||
\wxheading{See also}
|
%%
|
||||||
|
%% \docparam{event}{The colour change event.}
|
||||||
\helpref{wxStatusBar::InitColours}{wxstatusbarinitcolours}
|
%%
|
||||||
|
%% \wxheading{See also}
|
||||||
|
%%
|
||||||
|
%% \helpref{wxStatusBar::InitColours}{wxstatusbarinitcolours}
|
||||||
|
|
||||||
\membersection{wxStatusBar::SetFieldsCount}\label{wxstatusbarsetfieldscount}
|
\membersection{wxStatusBar::SetFieldsCount}\label{wxstatusbarsetfieldscount}
|
||||||
|
|
||||||
@@ -246,15 +249,27 @@ Sets the text for one field.
|
|||||||
|
|
||||||
\func{virtual void}{SetStatusWidths}{\param{int}{ n}, \param{int *}{widths}}
|
\func{virtual void}{SetStatusWidths}{\param{int}{ n}, \param{int *}{widths}}
|
||||||
|
|
||||||
Sets the widths of the fields in the status line.
|
Sets the widths of the fields in the status line. There are two types of
|
||||||
|
fields: fixed widths one and variable width fields. For the fixed width fields
|
||||||
|
you should specify their (constant) width in pixels. For the variable width
|
||||||
|
fields, specify a negative number which indicates how should the field expand:
|
||||||
|
the space left for all variable width fields is divided between them according
|
||||||
|
to the absolute value of this number. A variable width field with width of $-2$
|
||||||
|
gets twice as much of it as a field with width $-1$ and so on.
|
||||||
|
|
||||||
|
For example, to create one fixed width field of width $50$ in the right part of
|
||||||
|
the status bar and two more fields which get $66$\% and $33$\% of the remaining
|
||||||
|
space correspondingly, you should use an array containing $-2$, $-1$ and $100$.
|
||||||
|
|
||||||
\wxheading{Parameters}
|
\wxheading{Parameters}
|
||||||
|
|
||||||
\docparam{n}{The number of fields in the status bar.}
|
\docparam{n}{The number of fields in the status bar. Must be equal to the
|
||||||
|
number passed to \helpref{SetFieldsCount}{wxstatusbarsetfieldscount} the last
|
||||||
|
time it was called.}
|
||||||
|
|
||||||
\docparam{widths}{Must contain an array of {\it n} integers, each of which is a status field width
|
\docparam{widths}{Contains an array of {\it n} integers, each of which is
|
||||||
in pixels. A value of -1 indicates that the field is variable width; at least one
|
either an absolute status field width in pixels if positive or indicates a
|
||||||
field must be -1. You should delete this array after calling {\bf SetStatusWidths}.}
|
variable width field if negative}
|
||||||
|
|
||||||
\wxheading{Remarks}
|
\wxheading{Remarks}
|
||||||
|
|
||||||
|
@@ -12,6 +12,10 @@
|
|||||||
#ifndef _WX_STATUSBR_H_BASE_
|
#ifndef _WX_STATUSBR_H_BASE_
|
||||||
#define _WX_STATUSBR_H_BASE_
|
#define _WX_STATUSBR_H_BASE_
|
||||||
|
|
||||||
|
#ifdef __GNUG__
|
||||||
|
#pragma interface "statbar.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "wx/window.h"
|
#include "wx/window.h"
|
||||||
|
|
||||||
#if wxUSE_STATUSBAR
|
#if wxUSE_STATUSBAR
|
||||||
@@ -23,19 +27,37 @@
|
|||||||
class WXDLLEXPORT wxStatusBarBase : public wxWindow
|
class WXDLLEXPORT wxStatusBarBase : public wxWindow
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
wxStatusBarBase() { m_statusWidths = NULL; }
|
wxStatusBarBase();
|
||||||
|
|
||||||
// get/set the number of fields
|
virtual ~wxStatusBarBase();
|
||||||
virtual void SetFieldsCount(int number = 1,
|
|
||||||
const int *widths = (const int *) NULL) = 0;
|
// field count
|
||||||
|
// -----------
|
||||||
|
|
||||||
|
// set the number of fields and call SetStatusWidths(widths) if widths are
|
||||||
|
// given
|
||||||
|
virtual void SetFieldsCount(int number = 1, const int *widths = NULL);
|
||||||
int GetFieldsCount() const { return m_nFields; }
|
int GetFieldsCount() const { return m_nFields; }
|
||||||
|
|
||||||
// get/set the text of the given field
|
// field text
|
||||||
|
// ----------
|
||||||
|
|
||||||
virtual void SetStatusText(const wxString& text, int number = 0) = 0;
|
virtual void SetStatusText(const wxString& text, int number = 0) = 0;
|
||||||
virtual wxString GetStatusText(int number = 0) const = 0;
|
virtual wxString GetStatusText(int number = 0) const = 0;
|
||||||
|
|
||||||
// set status line widths (n should be the same as field count)
|
// fields widths
|
||||||
virtual void SetStatusWidths(int n, const int widths[]) = 0;
|
// -------------
|
||||||
|
|
||||||
|
// set status field widths as absolute numbers: positive widths mean that
|
||||||
|
// the field has the specified absolute width, negative widths are
|
||||||
|
// interpreted as the sizer options, i.e. the extra space (total space
|
||||||
|
// minus the sum of fixed width fields) is divided between the fields with
|
||||||
|
// negative width according to the abs value of the width (field with width
|
||||||
|
// -2 grows twice as much as one with width -1 &c)
|
||||||
|
virtual void SetStatusWidths(int n, const int widths[]);
|
||||||
|
|
||||||
|
// geometry
|
||||||
|
// --------
|
||||||
|
|
||||||
// Get the position and size of the field's internal bounding rectangle
|
// Get the position and size of the field's internal bounding rectangle
|
||||||
virtual bool GetFieldRect(int i, wxRect& rect) const = 0;
|
virtual bool GetFieldRect(int i, wxRect& rect) const = 0;
|
||||||
@@ -51,54 +73,54 @@ public:
|
|||||||
virtual bool AcceptsFocus() const { return FALSE; }
|
virtual bool AcceptsFocus() const { return FALSE; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
int m_nFields; // the current number of fields
|
// set the widths array to NULL
|
||||||
int *m_statusWidths; // the width (if !NULL) of the fields
|
void InitWidths();
|
||||||
|
|
||||||
|
// free the status widths arrays
|
||||||
|
void FreeWidths();
|
||||||
|
|
||||||
|
// reset the widths
|
||||||
|
void ReinitWidths() { FreeWidths(); InitWidths(); }
|
||||||
|
|
||||||
|
// calculate the real field widths for the given total available size
|
||||||
|
wxArrayInt CalculateAbsWidths(wxCoord widthTotal) const;
|
||||||
|
|
||||||
|
// the current number of fields
|
||||||
|
int m_nFields;
|
||||||
|
|
||||||
|
// the widths of the fields in pixels if !NULL, all fields have the same
|
||||||
|
// width otherwise
|
||||||
|
int *m_statusWidths;
|
||||||
};
|
};
|
||||||
|
|
||||||
#if defined(__WIN32__) && wxUSE_NATIVE_STATUSBAR
|
// ----------------------------------------------------------------------------
|
||||||
#include "wx/msw/statbr95.h"
|
// include the actual wxStatusBar class declaration
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
typedef wxStatusBar95 wxStatusBarReal;
|
#if defined(__WXUNIVERSAL__)
|
||||||
|
#define wxStatusBarUniv wxStatusBar
|
||||||
|
#define sm_classwxStatusBarUniv sm_classwxStatusBar
|
||||||
|
|
||||||
|
#include "wx/univ/statusbr.h"
|
||||||
|
#elif defined(__WIN32__) && wxUSE_NATIVE_STATUSBAR
|
||||||
|
#define wxStatusBar95 wxStatusBar
|
||||||
|
#define sm_classwxStatusBar95 sm_classwxStatusBar
|
||||||
|
|
||||||
|
#include "wx/msw/statbr95.h"
|
||||||
#elif defined(__WXMAC__)
|
#elif defined(__WXMAC__)
|
||||||
|
#define wxStatusBarMac wxStatusBar
|
||||||
|
#define sm_classwxStatusBarMac sm_classwxStatusBar
|
||||||
|
|
||||||
#include "wx/generic/statusbr.h"
|
#include "wx/generic/statusbr.h"
|
||||||
#include "wx/mac/statusbr.h"
|
#include "wx/mac/statusbr.h"
|
||||||
|
|
||||||
typedef wxStatusBarMac wxStatusBarReal;
|
|
||||||
#else
|
#else
|
||||||
|
#define wxStatusBarGeneric wxStatusBar
|
||||||
|
#define sm_classwxStatusBarGeneric sm_classwxStatusBar
|
||||||
|
|
||||||
#include "wx/generic/statusbr.h"
|
#include "wx/generic/statusbr.h"
|
||||||
|
|
||||||
typedef wxStatusBarGeneric wxStatusBarReal;
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// we can't just typedef wxStatusBar to be one of 95/Generic because we should
|
#endif // wxUSE_STATUSBAR
|
||||||
// be able to forward declare it (done in several places) and because wxWin
|
|
||||||
// RTTI wouldn't work then
|
|
||||||
class WXDLLEXPORT wxStatusBar : public wxStatusBarReal
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
wxStatusBar() { }
|
|
||||||
wxStatusBar(wxWindow *parent,
|
|
||||||
wxWindowID id,
|
|
||||||
const wxPoint& WXUNUSED(pos) = wxDefaultPosition,
|
|
||||||
const wxSize& WXUNUSED(size) = wxDefaultSize,
|
|
||||||
long style = wxST_SIZEGRIP,
|
|
||||||
const wxString& name = wxPanelNameStr)
|
|
||||||
{
|
|
||||||
Create(parent, id, style, name);
|
|
||||||
}
|
|
||||||
wxStatusBar(wxWindow *parent,
|
|
||||||
wxWindowID id,
|
|
||||||
long style,
|
|
||||||
const wxString& name = wxPanelNameStr)
|
|
||||||
{
|
|
||||||
Create(parent, id, style, name);
|
|
||||||
}
|
|
||||||
|
|
||||||
private:
|
|
||||||
DECLARE_DYNAMIC_CLASS(wxStatusBar)
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
// _WX_STATUSBR_H_BASE_
|
// _WX_STATUSBR_H_BASE_
|
||||||
|
@@ -1035,6 +1035,8 @@ public:
|
|||||||
size_t Add(const wxString& str);
|
size_t Add(const wxString& str);
|
||||||
// add new element at given position
|
// add new element at given position
|
||||||
void Insert(const wxString& str, size_t uiIndex);
|
void Insert(const wxString& str, size_t uiIndex);
|
||||||
|
// expand the array to have count elements
|
||||||
|
void SetCount(size_t count);
|
||||||
// remove first item matching this value
|
// remove first item matching this value
|
||||||
void Remove(const wxChar *sz);
|
void Remove(const wxChar *sz);
|
||||||
// remove item by index
|
// remove item by index
|
||||||
|
@@ -35,6 +35,7 @@
|
|||||||
#define wxINP_HANDLER_SCROLLBAR _T("scrollbar")
|
#define wxINP_HANDLER_SCROLLBAR _T("scrollbar")
|
||||||
#define wxINP_HANDLER_SLIDER _T("slider")
|
#define wxINP_HANDLER_SLIDER _T("slider")
|
||||||
#define wxINP_HANDLER_SPINBTN _T("spinbtn")
|
#define wxINP_HANDLER_SPINBTN _T("spinbtn")
|
||||||
|
#define wxINP_HANDLER_STATUSBAR _T("statusbar")
|
||||||
#define wxINP_HANDLER_TEXTCTRL _T("textctrl")
|
#define wxINP_HANDLER_TEXTCTRL _T("textctrl")
|
||||||
#define wxINP_HANDLER_TOPLEVEL _T("toplevel")
|
#define wxINP_HANDLER_TOPLEVEL _T("toplevel")
|
||||||
|
|
||||||
|
@@ -26,24 +26,10 @@
|
|||||||
class WXDLLEXPORT wxMenuInfo;
|
class WXDLLEXPORT wxMenuInfo;
|
||||||
WX_DECLARE_OBJARRAY(wxMenuInfo, wxMenuInfoArray);
|
WX_DECLARE_OBJARRAY(wxMenuInfo, wxMenuInfoArray);
|
||||||
|
|
||||||
class wxPopupMenuWindow;
|
class WXDLLEXPORT wxMenuGeometryInfo;
|
||||||
|
class WXDLLEXPORT wxPopupMenuWindow;
|
||||||
class WXDLLEXPORT wxRenderer;
|
class WXDLLEXPORT wxRenderer;
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
|
||||||
// wxMenu helper classes, used in implementation only
|
|
||||||
// ----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
// used by wxRenderer
|
|
||||||
class WXDLLEXPORT wxMenuGeometryInfo
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
// get the total size of the menu
|
|
||||||
virtual wxSize GetSize() const = 0;
|
|
||||||
|
|
||||||
virtual ~wxMenuGeometryInfo();
|
|
||||||
};
|
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
// wxMenu
|
// wxMenu
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
@@ -44,6 +44,16 @@ class WXDLLEXPORT wxGauge;
|
|||||||
#include "wx/gdicmn.h"
|
#include "wx/gdicmn.h"
|
||||||
#include "wx/scrolbar.h" // for wxScrollBar::Element
|
#include "wx/scrolbar.h" // for wxScrollBar::Element
|
||||||
|
|
||||||
|
// helper class used by wxMenu-related functions
|
||||||
|
class WXDLLEXPORT wxMenuGeometryInfo
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
// get the total size of the menu
|
||||||
|
virtual wxSize GetSize() const = 0;
|
||||||
|
|
||||||
|
virtual ~wxMenuGeometryInfo();
|
||||||
|
};
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
// wxRenderer: abstract renderers interface
|
// wxRenderer: abstract renderers interface
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
@@ -220,7 +230,6 @@ public:
|
|||||||
int step = 1,
|
int step = 1,
|
||||||
int flags = 0) = 0;
|
int flags = 0) = 0;
|
||||||
|
|
||||||
#if wxUSE_MENUS
|
|
||||||
// draw a menu bar item
|
// draw a menu bar item
|
||||||
virtual void DrawMenuBarItem(wxDC& dc,
|
virtual void DrawMenuBarItem(wxDC& dc,
|
||||||
const wxRect& rect,
|
const wxRect& rect,
|
||||||
@@ -244,7 +253,14 @@ public:
|
|||||||
virtual void DrawMenuSeparator(wxDC& dc,
|
virtual void DrawMenuSeparator(wxDC& dc,
|
||||||
wxCoord y,
|
wxCoord y,
|
||||||
const wxMenuGeometryInfo& geomInfo) = 0;
|
const wxMenuGeometryInfo& geomInfo) = 0;
|
||||||
#endif
|
|
||||||
|
// draw a status bar field: wxCONTROL_ISDEFAULT bit in the flags is
|
||||||
|
// interpreted specially and means "draw the status bar grip" here
|
||||||
|
virtual void DrawStatusField(wxDC& dc,
|
||||||
|
const wxRect& rect,
|
||||||
|
const wxString& label,
|
||||||
|
int flags = 0) = 0;
|
||||||
|
|
||||||
// draw complete frame/dialog titlebar
|
// draw complete frame/dialog titlebar
|
||||||
virtual void DrawFrameTitleBar(wxDC& dc,
|
virtual void DrawFrameTitleBar(wxDC& dc,
|
||||||
const wxRect& rect,
|
const wxRect& rect,
|
||||||
@@ -253,7 +269,7 @@ public:
|
|||||||
int flags,
|
int flags,
|
||||||
int specialButton = 0,
|
int specialButton = 0,
|
||||||
int specialButtonFlags = 0) = 0;
|
int specialButtonFlags = 0) = 0;
|
||||||
|
|
||||||
// draw frame borders
|
// draw frame borders
|
||||||
virtual void DrawFrameBorder(wxDC& dc,
|
virtual void DrawFrameBorder(wxDC& dc,
|
||||||
const wxRect& rect,
|
const wxRect& rect,
|
||||||
@@ -373,7 +389,6 @@ public:
|
|||||||
// get the size of one progress bar step (in horz and vertical directions)
|
// get the size of one progress bar step (in horz and vertical directions)
|
||||||
virtual wxSize GetProgressBarStep() const = 0;
|
virtual wxSize GetProgressBarStep() const = 0;
|
||||||
|
|
||||||
#if wxUSE_MENUS
|
|
||||||
// get the size of rectangle to use in the menubar for the given text rect
|
// get the size of rectangle to use in the menubar for the given text rect
|
||||||
virtual wxSize GetMenuBarItemSize(const wxSize& sizeText) const = 0;
|
virtual wxSize GetMenuBarItemSize(const wxSize& sizeText) const = 0;
|
||||||
|
|
||||||
@@ -384,19 +399,25 @@ public:
|
|||||||
// the returned pointer must be deleted by the caller
|
// the returned pointer must be deleted by the caller
|
||||||
virtual wxMenuGeometryInfo *GetMenuGeometry(wxWindow *win,
|
virtual wxMenuGeometryInfo *GetMenuGeometry(wxWindow *win,
|
||||||
const wxMenu& menu) const = 0;
|
const wxMenu& menu) const = 0;
|
||||||
#endif
|
|
||||||
|
// get the borders around the status bar fields (x and y fields of the
|
||||||
|
// return value) and also, optionally, the border between the fields
|
||||||
|
virtual wxSize GetStatusBarBorders(wxCoord *borderBetweenFields) const = 0;
|
||||||
|
|
||||||
// get client area rectangle of top level window (i.e. subtract
|
// get client area rectangle of top level window (i.e. subtract
|
||||||
// decorations from given rectangle)
|
// decorations from given rectangle)
|
||||||
virtual wxRect GetFrameClientArea(const wxRect& rect, int flags) const = 0;
|
virtual wxRect GetFrameClientArea(const wxRect& rect, int flags) const = 0;
|
||||||
|
|
||||||
// get size of whole top level window, given size of its client area size
|
// get size of whole top level window, given size of its client area size
|
||||||
virtual wxSize GetFrameTotalSize(const wxSize& clientSize, int flags) const = 0;
|
virtual wxSize GetFrameTotalSize(const wxSize& clientSize, int flags) const = 0;
|
||||||
|
|
||||||
// get titlebar icon size
|
// get titlebar icon size
|
||||||
virtual wxSize GetFrameIconSize() const = 0;
|
virtual wxSize GetFrameIconSize() const = 0;
|
||||||
|
|
||||||
// returns one of wxHT_TOPLEVEL_XXX constants
|
// returns one of wxHT_TOPLEVEL_XXX constants
|
||||||
virtual int HitTestFrame(const wxRect& rect,
|
virtual int HitTestFrame(const wxRect& rect,
|
||||||
const wxPoint& pt,
|
const wxPoint& pt,
|
||||||
int flags) const = 0;
|
int flags = 0) const = 0;
|
||||||
|
|
||||||
// virtual dtor for any base class
|
// virtual dtor for any base class
|
||||||
virtual ~wxRenderer();
|
virtual ~wxRenderer();
|
||||||
@@ -599,7 +620,6 @@ public:
|
|||||||
int flags = 0)
|
int flags = 0)
|
||||||
{ m_renderer->DrawSliderTicks(dc, rect, sizeThumb, orient,
|
{ m_renderer->DrawSliderTicks(dc, rect, sizeThumb, orient,
|
||||||
start, end, start, flags); }
|
start, end, start, flags); }
|
||||||
#if wxUSE_MENUS
|
|
||||||
|
|
||||||
virtual void DrawMenuBarItem(wxDC& dc,
|
virtual void DrawMenuBarItem(wxDC& dc,
|
||||||
const wxRect& rect,
|
const wxRect& rect,
|
||||||
@@ -621,7 +641,13 @@ public:
|
|||||||
wxCoord y,
|
wxCoord y,
|
||||||
const wxMenuGeometryInfo& geomInfo)
|
const wxMenuGeometryInfo& geomInfo)
|
||||||
{ m_renderer->DrawMenuSeparator(dc, y, geomInfo); }
|
{ m_renderer->DrawMenuSeparator(dc, y, geomInfo); }
|
||||||
#endif
|
|
||||||
|
virtual void DrawStatusField(wxDC& dc,
|
||||||
|
const wxRect& rect,
|
||||||
|
const wxString& label,
|
||||||
|
int flags = 0)
|
||||||
|
{ m_renderer->DrawStatusField(dc, rect, label, flags); }
|
||||||
|
|
||||||
virtual void DrawFrameTitleBar(wxDC& dc,
|
virtual void DrawFrameTitleBar(wxDC& dc,
|
||||||
const wxRect& rect,
|
const wxRect& rect,
|
||||||
const wxString& title,
|
const wxString& title,
|
||||||
@@ -629,7 +655,7 @@ public:
|
|||||||
int flags,
|
int flags,
|
||||||
int specialButton = 0,
|
int specialButton = 0,
|
||||||
int specialButtonFlag = 0)
|
int specialButtonFlag = 0)
|
||||||
{ m_renderer->DrawFrameTitleBar(dc, rect, title, icon, flags,
|
{ m_renderer->DrawFrameTitleBar(dc, rect, title, icon, flags,
|
||||||
specialButton, specialButtonFlag); }
|
specialButton, specialButtonFlag); }
|
||||||
virtual void DrawFrameBorder(wxDC& dc,
|
virtual void DrawFrameBorder(wxDC& dc,
|
||||||
const wxRect& rect,
|
const wxRect& rect,
|
||||||
@@ -717,13 +743,13 @@ public:
|
|||||||
{ return m_renderer->GetSliderThumbSize(rect, orient); }
|
{ return m_renderer->GetSliderThumbSize(rect, orient); }
|
||||||
virtual wxSize GetProgressBarStep() const
|
virtual wxSize GetProgressBarStep() const
|
||||||
{ return m_renderer->GetProgressBarStep(); }
|
{ return m_renderer->GetProgressBarStep(); }
|
||||||
#if wxUSE_MENUS
|
|
||||||
virtual wxSize GetMenuBarItemSize(const wxSize& sizeText) const
|
virtual wxSize GetMenuBarItemSize(const wxSize& sizeText) const
|
||||||
{ return m_renderer->GetMenuBarItemSize(sizeText); }
|
{ return m_renderer->GetMenuBarItemSize(sizeText); }
|
||||||
virtual wxMenuGeometryInfo *GetMenuGeometry(wxWindow *win,
|
virtual wxMenuGeometryInfo *GetMenuGeometry(wxWindow *win,
|
||||||
const wxMenu& menu) const
|
const wxMenu& menu) const
|
||||||
{ return m_renderer->GetMenuGeometry(win, menu); }
|
{ return m_renderer->GetMenuGeometry(win, menu); }
|
||||||
#endif
|
virtual wxSize GetStatusBarBorders(wxCoord *borderBetweenFields) const
|
||||||
|
{ return m_renderer->GetStatusBarBorders(borderBetweenFields); }
|
||||||
virtual wxRect GetFrameClientArea(const wxRect& rect, int flags) const
|
virtual wxRect GetFrameClientArea(const wxRect& rect, int flags) const
|
||||||
{ return m_renderer->GetFrameClientArea(rect, flags); }
|
{ return m_renderer->GetFrameClientArea(rect, flags); }
|
||||||
virtual wxSize GetFrameTotalSize(const wxSize& clientSize, int flags) const
|
virtual wxSize GetFrameTotalSize(const wxSize& clientSize, int flags) const
|
||||||
|
@@ -98,7 +98,7 @@
|
|||||||
#define wxUSE_STATLINE 1
|
#define wxUSE_STATLINE 1
|
||||||
#define wxUSE_STATTEXT 1
|
#define wxUSE_STATTEXT 1
|
||||||
#define wxUSE_STATBMP 1
|
#define wxUSE_STATBMP 1
|
||||||
#define wxUSE_STATUSBAR 0
|
#define wxUSE_STATUSBAR 1
|
||||||
#define wxUSE_TEXTCTRL 1
|
#define wxUSE_TEXTCTRL 1
|
||||||
#define wxUSE_TOOLTIPS 0
|
#define wxUSE_TOOLTIPS 0
|
||||||
#define wxUSE_TREECTRL 0
|
#define wxUSE_TREECTRL 0
|
||||||
@@ -121,7 +121,7 @@
|
|||||||
#define wxUSE_FILEDLG 0
|
#define wxUSE_FILEDLG 0
|
||||||
#define wxUSE_COLOURDLG 0
|
#define wxUSE_COLOURDLG 0
|
||||||
#define wxUSE_CHOICEDLG 0
|
#define wxUSE_CHOICEDLG 0
|
||||||
#define wxUSE_NUMBERDLG 0
|
#define wxUSE_NUMBERDLG 1
|
||||||
#define wxUSE_STARTUP_TIPS 0
|
#define wxUSE_STARTUP_TIPS 0
|
||||||
#define wxUSE_MSGDLG 1
|
#define wxUSE_MSGDLG 1
|
||||||
#define wxUSE_SPLITTER 1
|
#define wxUSE_SPLITTER 1
|
||||||
@@ -252,7 +252,7 @@
|
|||||||
#define wxUSE_STATLINE 1
|
#define wxUSE_STATLINE 1
|
||||||
#define wxUSE_STATTEXT 1
|
#define wxUSE_STATTEXT 1
|
||||||
#define wxUSE_STATBMP 1
|
#define wxUSE_STATBMP 1
|
||||||
#define wxUSE_STATUSBAR 0
|
#define wxUSE_STATUSBAR 1
|
||||||
#define wxUSE_TEXTCTRL 1
|
#define wxUSE_TEXTCTRL 1
|
||||||
#define wxUSE_TOOLTIPS 0
|
#define wxUSE_TOOLTIPS 0
|
||||||
#define wxUSE_TREECTRL 0
|
#define wxUSE_TREECTRL 0
|
||||||
@@ -275,7 +275,7 @@
|
|||||||
#define wxUSE_COLOURDLG 0
|
#define wxUSE_COLOURDLG 0
|
||||||
#define wxUSE_TEXTDLG 0
|
#define wxUSE_TEXTDLG 0
|
||||||
#define wxUSE_CHOICEDLG 0
|
#define wxUSE_CHOICEDLG 0
|
||||||
#define wxUSE_NUMBERDLG 0
|
#define wxUSE_NUMBERDLG 1
|
||||||
#define wxUSE_STARTUP_TIPS 0
|
#define wxUSE_STARTUP_TIPS 0
|
||||||
#define wxUSE_MSGDLG 1
|
#define wxUSE_MSGDLG 1
|
||||||
#define wxUSE_SPLITTER 1
|
#define wxUSE_SPLITTER 1
|
||||||
|
108
include/wx/univ/statusbr.h
Normal file
108
include/wx/univ/statusbr.h
Normal file
@@ -0,0 +1,108 @@
|
|||||||
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Name: wx/univ/statusbr.h
|
||||||
|
// Purpose: wxStatusBarUniv: wxStatusBar for wxUniversal declaration
|
||||||
|
// Author: Vadim Zeitlin
|
||||||
|
// Modified by:
|
||||||
|
// Created: 14.10.01
|
||||||
|
// RCS-ID: $Id$
|
||||||
|
// Copyright: (c) 2001 SciTech Software, Inc. (www.scitechsoft.com)
|
||||||
|
// Licence: wxWindows licence
|
||||||
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#ifndef _WX_UNIV_STATUSBR_H_
|
||||||
|
#define _WX_UNIV_STATUSBR_H_
|
||||||
|
|
||||||
|
#ifdef __GNUG__
|
||||||
|
#pragma interface "univstatusbr.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
// wxStatusBar: a window near the bottom of the frame used for status info
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
class WXDLLEXPORT wxStatusBarUniv : public wxStatusBarBase,
|
||||||
|
public wxInputConsumer
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
wxStatusBarUniv() { Init(); }
|
||||||
|
|
||||||
|
wxStatusBarUniv(wxWindow *parent,
|
||||||
|
wxWindowID id = -1,
|
||||||
|
long style = 0,
|
||||||
|
const wxString& name = wxPanelNameStr)
|
||||||
|
{
|
||||||
|
Init();
|
||||||
|
|
||||||
|
(void)Create(parent, id, style, name);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Create(wxWindow *parent,
|
||||||
|
wxWindowID id = -1,
|
||||||
|
long style = 0,
|
||||||
|
const wxString& name = wxPanelNameStr);
|
||||||
|
|
||||||
|
// set field count/widths
|
||||||
|
virtual void SetFieldsCount(int number = 1, const int *widths = NULL);
|
||||||
|
virtual void SetStatusWidths(int n, const int widths[]);
|
||||||
|
|
||||||
|
// get/set the text of the given field
|
||||||
|
virtual void SetStatusText(const wxString& text, int number = 0);
|
||||||
|
virtual wxString GetStatusText(int number = 0) const;
|
||||||
|
|
||||||
|
// Get the position and size of the field's internal bounding rectangle
|
||||||
|
virtual bool GetFieldRect(int i, wxRect& rect) const;
|
||||||
|
|
||||||
|
// sets the minimal vertical size of the status bar
|
||||||
|
virtual void SetMinHeight(int height);
|
||||||
|
|
||||||
|
// get the dimensions of the horizontal and vertical borders
|
||||||
|
virtual int GetBorderX() const;
|
||||||
|
virtual int GetBorderY() const;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
// recalculate the field widths
|
||||||
|
void OnSize(wxSizeEvent& event);
|
||||||
|
|
||||||
|
// draw the statusbar
|
||||||
|
virtual void DoDraw(wxControlRenderer *renderer);
|
||||||
|
|
||||||
|
// wxInputConsumer pure virtual
|
||||||
|
virtual wxWindow *GetInputWindow() const
|
||||||
|
{ return wxConstCast(this, wxStatusBar); }
|
||||||
|
|
||||||
|
// tell them about our preferred height
|
||||||
|
virtual wxSize DoGetBestSize() const;
|
||||||
|
|
||||||
|
// override DoSetSize() to prevent the status bar height from changing
|
||||||
|
virtual void DoSetSize(int x, int y,
|
||||||
|
int width, int height,
|
||||||
|
int sizeFlags = wxSIZE_AUTO);
|
||||||
|
|
||||||
|
// get the (fixed) status bar height
|
||||||
|
wxCoord GetHeight() const;
|
||||||
|
|
||||||
|
// get the rectangle containing all the fields and the border between them
|
||||||
|
//
|
||||||
|
// also updates m_widthsAbs if necessary
|
||||||
|
wxRect GetTotalFieldRect(wxCoord *borderBetweenFields);
|
||||||
|
|
||||||
|
// refresh the given field
|
||||||
|
void RefreshField(int i);
|
||||||
|
|
||||||
|
// common part of all ctors
|
||||||
|
void Init();
|
||||||
|
|
||||||
|
private:
|
||||||
|
// the status fields strings
|
||||||
|
wxArrayString m_statusText;
|
||||||
|
|
||||||
|
// the absolute status fields widths
|
||||||
|
wxArrayInt m_widthsAbs;
|
||||||
|
|
||||||
|
DECLARE_DYNAMIC_CLASS(wxStatusBarUniv)
|
||||||
|
DECLARE_EVENT_TABLE()
|
||||||
|
WX_DECLARE_INPUT_CONSUMER()
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // _WX_UNIV_STATUSBR_H_
|
||||||
|
|
@@ -35,7 +35,7 @@ enum
|
|||||||
wxTOPLEVEL_BUTTON_MAXIMIZE = 0x02000000,
|
wxTOPLEVEL_BUTTON_MAXIMIZE = 0x02000000,
|
||||||
wxTOPLEVEL_BUTTON_ICONIZE = 0x04000000,
|
wxTOPLEVEL_BUTTON_ICONIZE = 0x04000000,
|
||||||
wxTOPLEVEL_BUTTON_RESTORE = 0x08000000,
|
wxTOPLEVEL_BUTTON_RESTORE = 0x08000000,
|
||||||
wxTOPLEVEL_BUTTON_HELP = 0x10000000,
|
wxTOPLEVEL_BUTTON_HELP = 0x10000000,
|
||||||
};
|
};
|
||||||
|
|
||||||
// frame hit test return values:
|
// frame hit test return values:
|
||||||
@@ -115,14 +115,15 @@ public:
|
|||||||
|
|
||||||
// implementation from now on
|
// implementation from now on
|
||||||
// --------------------------
|
// --------------------------
|
||||||
|
|
||||||
// tests for frame's part at given point
|
// tests for frame's part at given point
|
||||||
long HitTest(const wxPoint& pt) const;
|
long HitTest(const wxPoint& pt) const;
|
||||||
|
|
||||||
protected:
|
|
||||||
virtual bool PerformAction(const wxControlAction& action,
|
virtual bool PerformAction(const wxControlAction& action,
|
||||||
long numArg = -1,
|
long numArg = -1,
|
||||||
const wxString& strArg = wxEmptyString);
|
const wxString& strArg = wxEmptyString);
|
||||||
|
|
||||||
|
protected:
|
||||||
// handle titlebar button click event
|
// handle titlebar button click event
|
||||||
virtual void ClickTitleBarButton(long button);
|
virtual void ClickTitleBarButton(long button);
|
||||||
|
|
||||||
@@ -133,7 +134,7 @@ protected:
|
|||||||
|
|
||||||
// common part of all ctors
|
// common part of all ctors
|
||||||
void Init();
|
void Init();
|
||||||
|
|
||||||
void RefreshTitleBar();
|
void RefreshTitleBar();
|
||||||
void OnNcPaint(wxPaintEvent& event);
|
void OnNcPaint(wxPaintEvent& event);
|
||||||
|
|
||||||
|
@@ -341,16 +341,20 @@ void MyFrame::OnSetStatusFields(wxCommandEvent& WXUNUSED(event))
|
|||||||
// SetFieldsCount() with the same number of fields should be ok
|
// SetFieldsCount() with the same number of fields should be ok
|
||||||
if ( nFields != -1 )
|
if ( nFields != -1 )
|
||||||
{
|
{
|
||||||
// we set the widths only for 2 of them, otherwise let all the fields
|
static const int widthsFor2Fields[] = { 200, -1 };
|
||||||
// have equal width (the default behaviour)
|
static const int widthsFor3Fields[] = { -1, -2, -1 };
|
||||||
const int *widths = NULL;
|
static const int widthsFor4Fields[] = { 100, -1, 100, -2, 100 };
|
||||||
if ( nFields == 2 )
|
|
||||||
{
|
|
||||||
static const int widthsFor2Fields[2] = { 200, -1 };
|
|
||||||
widths = widthsFor2Fields;
|
|
||||||
}
|
|
||||||
|
|
||||||
sb->SetFieldsCount(nFields, widths);
|
static const int *widths[] =
|
||||||
|
{
|
||||||
|
NULL, // 1 field: default
|
||||||
|
widthsFor2Fields, // 2 fields: 1 fixed, 1 var
|
||||||
|
widthsFor3Fields, // 3 fields: 3 var
|
||||||
|
widthsFor4Fields, // 4 fields: 3 fixed, 2 vars
|
||||||
|
NULL // 5 fields: default (all have same width)
|
||||||
|
};
|
||||||
|
|
||||||
|
sb->SetFieldsCount(nFields, widths[nFields - 1]);
|
||||||
|
|
||||||
wxLogStatus(this,
|
wxLogStatus(this,
|
||||||
wxString::Format(wxT("Status bar now has %ld fields"),
|
wxString::Format(wxT("Status bar now has %ld fields"),
|
||||||
@@ -447,7 +451,9 @@ MyStatusBar::MyStatusBar(wxWindow *parent)
|
|||||||
#ifdef USE_STATIC_BITMAP
|
#ifdef USE_STATIC_BITMAP
|
||||||
m_statbmp = new wxStaticBitmap(this, -1, wxIcon(green_xpm));
|
m_statbmp = new wxStaticBitmap(this, -1, wxIcon(green_xpm));
|
||||||
#else
|
#else
|
||||||
m_statbmp = new wxBitmapButton(this, -1, CreateBitmapForButton());
|
m_statbmp = new wxBitmapButton(this, -1, CreateBitmapForButton(),
|
||||||
|
wxDefaultPosition, wxDefaultSize,
|
||||||
|
wxBU_EXACTFIT);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
m_timer.Start(1000);
|
m_timer.Start(1000);
|
||||||
@@ -497,11 +503,7 @@ void MyStatusBar::OnSize(wxSizeEvent& event)
|
|||||||
m_checkbox->SetSize(rect.x + 2, rect.y + 2, rect.width - 4, rect.height - 4);
|
m_checkbox->SetSize(rect.x + 2, rect.y + 2, rect.width - 4, rect.height - 4);
|
||||||
|
|
||||||
GetFieldRect(Field_Bitmap, rect);
|
GetFieldRect(Field_Bitmap, rect);
|
||||||
#ifdef USE_BUTTON_FOR_BITMAP
|
|
||||||
wxSize size(BITMAP_SIZE_X, BITMAP_SIZE_Y);
|
|
||||||
#else
|
|
||||||
wxSize size = m_statbmp->GetSize();
|
wxSize size = m_statbmp->GetSize();
|
||||||
#endif
|
|
||||||
|
|
||||||
m_statbmp->Move(rect.x + (rect.width - size.x) / 2,
|
m_statbmp->Move(rect.x + (rect.width - size.x) / 2,
|
||||||
rect.y + (rect.height - size.y) / 2);
|
rect.y + (rect.height - size.y) / 2);
|
||||||
|
@@ -244,17 +244,6 @@ wxStatusBar *wxFrameBase::OnCreateStatusBar(int number,
|
|||||||
{
|
{
|
||||||
wxStatusBar *statusBar = new wxStatusBar(this, id, style, name);
|
wxStatusBar *statusBar = new wxStatusBar(this, id, style, name);
|
||||||
|
|
||||||
// Set the height according to the font and the border size
|
|
||||||
wxClientDC dc(statusBar);
|
|
||||||
dc.SetFont(statusBar->GetFont());
|
|
||||||
|
|
||||||
wxCoord y;
|
|
||||||
dc.GetTextExtent( "X", NULL, &y );
|
|
||||||
|
|
||||||
int height = (int)( (11*y)/10 + 2*statusBar->GetBorderY());
|
|
||||||
|
|
||||||
statusBar->SetSize( -1, -1, -1, height );
|
|
||||||
|
|
||||||
statusBar->SetFieldsCount(number);
|
statusBar->SetFieldsCount(number);
|
||||||
|
|
||||||
return statusBar;
|
return statusBar;
|
||||||
|
186
src/common/statbar.cpp
Normal file
186
src/common/statbar.cpp
Normal file
@@ -0,0 +1,186 @@
|
|||||||
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Name: common/statbar.cpp
|
||||||
|
// Purpose: wxStatusBarBase implementation
|
||||||
|
// Author: Vadim Zeitlin
|
||||||
|
// Modified by:
|
||||||
|
// Created: 14.10.01
|
||||||
|
// RCS-ID: $Id$
|
||||||
|
// Copyright: (c) 2001 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr>
|
||||||
|
// License: wxWindows license
|
||||||
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
// ============================================================================
|
||||||
|
// declarations
|
||||||
|
// ============================================================================
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
// headers
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
#ifdef __GNUG__
|
||||||
|
#pragma implementation "statbar.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// For compilers that support precompilation, includes "wx.h".
|
||||||
|
#include "wx/wxprec.h"
|
||||||
|
|
||||||
|
#ifdef __BORLANDC__
|
||||||
|
#pragma hdrstop
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef WX_PRECOMP
|
||||||
|
#include "wx/statusbr.h"
|
||||||
|
#endif //WX_PRECOMP
|
||||||
|
|
||||||
|
#if wxUSE_STATUSBAR
|
||||||
|
|
||||||
|
// ============================================================================
|
||||||
|
// wxStatusBarBase implementation
|
||||||
|
// ============================================================================
|
||||||
|
|
||||||
|
IMPLEMENT_DYNAMIC_CLASS(wxStatusBar, wxWindow)
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
// ctor/dtor
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
wxStatusBarBase::wxStatusBarBase()
|
||||||
|
{
|
||||||
|
m_nFields = 0;
|
||||||
|
|
||||||
|
InitWidths();
|
||||||
|
}
|
||||||
|
|
||||||
|
wxStatusBarBase::~wxStatusBarBase()
|
||||||
|
{
|
||||||
|
FreeWidths();
|
||||||
|
}
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
// widths array handling
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
void wxStatusBarBase::InitWidths()
|
||||||
|
{
|
||||||
|
m_statusWidths = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxStatusBarBase::FreeWidths()
|
||||||
|
{
|
||||||
|
delete [] m_statusWidths;
|
||||||
|
}
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
// field widths
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
void wxStatusBarBase::SetFieldsCount(int number, const int *widths)
|
||||||
|
{
|
||||||
|
wxCHECK_RET( number > 0, _T("invalid field number in SetFieldsCount") );
|
||||||
|
|
||||||
|
bool refresh = FALSE;
|
||||||
|
|
||||||
|
if ( number != m_nFields )
|
||||||
|
{
|
||||||
|
m_nFields = number;
|
||||||
|
|
||||||
|
ReinitWidths();
|
||||||
|
|
||||||
|
refresh = TRUE;
|
||||||
|
}
|
||||||
|
//else: keep the old m_statusWidths if we had them
|
||||||
|
|
||||||
|
if ( widths )
|
||||||
|
{
|
||||||
|
SetStatusWidths(number, widths);
|
||||||
|
|
||||||
|
// already done from SetStatusWidths()
|
||||||
|
refresh = FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( refresh )
|
||||||
|
Refresh();
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxStatusBarBase::SetStatusWidths(int WXUNUSED_UNLESS_DEBUG(n),
|
||||||
|
const int widths[])
|
||||||
|
{
|
||||||
|
wxCHECK_RET( widths, _T("NULL pointer in SetStatusWidths") );
|
||||||
|
|
||||||
|
wxASSERT_MSG( n == m_nFields, _T("field number mismatch") );
|
||||||
|
|
||||||
|
if ( !m_statusWidths )
|
||||||
|
m_statusWidths = new int[m_nFields];
|
||||||
|
|
||||||
|
for ( int i = 0; i < m_nFields; i++ )
|
||||||
|
{
|
||||||
|
m_statusWidths[i] = widths[i];
|
||||||
|
}
|
||||||
|
|
||||||
|
// update the display after the widths changed
|
||||||
|
Refresh();
|
||||||
|
}
|
||||||
|
|
||||||
|
wxArrayInt wxStatusBarBase::CalculateAbsWidths(wxCoord widthTotal) const
|
||||||
|
{
|
||||||
|
wxArrayInt widths;
|
||||||
|
|
||||||
|
if ( m_statusWidths == NULL )
|
||||||
|
{
|
||||||
|
// default: all fields have the same width
|
||||||
|
int nWidth = widthTotal / m_nFields;
|
||||||
|
for ( int i = 0; i < m_nFields; i++ )
|
||||||
|
{
|
||||||
|
widths.Add(nWidth);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else // have explicit status widths
|
||||||
|
{
|
||||||
|
// calculate the total width of all the fixed width fields and the
|
||||||
|
// total number of var field widths counting with multiplicity
|
||||||
|
int nTotalWidth = 0,
|
||||||
|
nVarCount = 0,
|
||||||
|
i;
|
||||||
|
for ( i = 0; i < m_nFields; i++ )
|
||||||
|
{
|
||||||
|
if ( m_statusWidths[i] >= 0 )
|
||||||
|
{
|
||||||
|
nTotalWidth += m_statusWidths[i];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
nVarCount += -m_statusWidths[i];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// the amount of extra width we have per each var width field
|
||||||
|
int nVarWidth;
|
||||||
|
if ( nVarCount )
|
||||||
|
{
|
||||||
|
int widthExtra = widthTotal - nTotalWidth;
|
||||||
|
nVarWidth = widthExtra > 0 ? widthExtra / nVarCount : 0;
|
||||||
|
}
|
||||||
|
else // no var width fields at all
|
||||||
|
{
|
||||||
|
nVarWidth = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
// do fill the array
|
||||||
|
for ( i = 0; i < m_nFields; i++ )
|
||||||
|
{
|
||||||
|
if ( m_statusWidths[i] >= 0 )
|
||||||
|
{
|
||||||
|
widths.Add(m_statusWidths[i]);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
widths.Add(-m_statusWidths[i]*nVarWidth);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return widths;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif // wxUSE_STATUSBAR
|
||||||
|
|
@@ -2156,6 +2156,16 @@ void wxArrayString::Insert(const wxString& str, size_t nIndex)
|
|||||||
m_nCount++;
|
m_nCount++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// expand the array
|
||||||
|
void wxArrayString::SetCount(size_t count)
|
||||||
|
{
|
||||||
|
Alloc(count);
|
||||||
|
|
||||||
|
wxString s;
|
||||||
|
while ( m_nCount < count )
|
||||||
|
m_pItems[m_nCount++] = (wxChar *)s.c_str();
|
||||||
|
}
|
||||||
|
|
||||||
// removes item from array (by index)
|
// removes item from array (by index)
|
||||||
void wxArrayString::Remove(size_t nIndex)
|
void wxArrayString::Remove(size_t nIndex)
|
||||||
{
|
{
|
||||||
|
@@ -69,13 +69,13 @@ protected:
|
|||||||
|
|
||||||
event.Skip();
|
event.Skip();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ProcessEvent(wxEvent &event)
|
bool ProcessEvent(wxEvent &event)
|
||||||
{
|
{
|
||||||
// Hand button down events to wxSpinCtrl. Doesn't work.
|
// Hand button down events to wxSpinCtrl. Doesn't work.
|
||||||
if (event.GetEventType() == wxEVT_LEFT_DOWN && m_spin->ProcessEvent( event ))
|
if (event.GetEventType() == wxEVT_LEFT_DOWN && m_spin->ProcessEvent( event ))
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
return wxTextCtrl::ProcessEvent( event );
|
return wxTextCtrl::ProcessEvent( event );
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -101,7 +101,7 @@ public:
|
|||||||
{
|
{
|
||||||
m_spin = spin;
|
m_spin = spin;
|
||||||
|
|
||||||
SetWindowStyle(style);
|
SetWindowStyle(style | wxSP_VERTICAL);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
@@ -155,6 +155,17 @@ bool wxSpinCtrl::Create(wxWindow *parent,
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// the string value overrides the numeric one (for backwards compatibility
|
||||||
|
// reasons and also because it is simpler to satisfy the string value which
|
||||||
|
// comes much sooner in the list of arguments and leave the initial
|
||||||
|
// parameter unspecified)
|
||||||
|
if ( !value.empty() )
|
||||||
|
{
|
||||||
|
long l;
|
||||||
|
if ( value.ToLong(&l) )
|
||||||
|
initial = l;
|
||||||
|
}
|
||||||
|
|
||||||
SetBackgroundColour(*wxRED);
|
SetBackgroundColour(*wxRED);
|
||||||
m_text = new wxSpinCtrlText(this, value);
|
m_text = new wxSpinCtrlText(this, value);
|
||||||
m_btn = new wxSpinCtrlButton(this, style);
|
m_btn = new wxSpinCtrlButton(this, style);
|
||||||
|
@@ -36,10 +36,6 @@
|
|||||||
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxStatusBarGeneric, wxWindow)
|
IMPLEMENT_DYNAMIC_CLASS(wxStatusBarGeneric, wxWindow)
|
||||||
|
|
||||||
#if !defined(__WIN32__) || !wxUSE_NATIVE_STATUSBAR
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxStatusBar, wxStatusBarGeneric)
|
|
||||||
#endif // Win32 && wxUSE_NATIVE_STATUSBAR
|
|
||||||
|
|
||||||
BEGIN_EVENT_TABLE(wxStatusBarGeneric, wxWindow)
|
BEGIN_EVENT_TABLE(wxStatusBarGeneric, wxWindow)
|
||||||
EVT_PAINT(wxStatusBarGeneric::OnPaint)
|
EVT_PAINT(wxStatusBarGeneric::OnPaint)
|
||||||
EVT_SYS_COLOUR_CHANGED(wxStatusBarGeneric::OnSysColourChanged)
|
EVT_SYS_COLOUR_CHANGED(wxStatusBarGeneric::OnSysColourChanged)
|
||||||
@@ -64,8 +60,6 @@ wxStatusBarGeneric::~wxStatusBarGeneric()
|
|||||||
SetFont(wxNullFont);
|
SetFont(wxNullFont);
|
||||||
# endif // MSW
|
# endif // MSW
|
||||||
|
|
||||||
if ( m_statusWidths )
|
|
||||||
delete[] m_statusWidths;
|
|
||||||
if ( m_statusStrings )
|
if ( m_statusStrings )
|
||||||
delete[] m_statusStrings;
|
delete[] m_statusStrings;
|
||||||
}
|
}
|
||||||
@@ -93,6 +87,17 @@ bool wxStatusBarGeneric::Create(wxWindow *parent,
|
|||||||
|
|
||||||
SetFont(m_defaultStatusBarFont);
|
SetFont(m_defaultStatusBarFont);
|
||||||
|
|
||||||
|
// Set the height according to the font and the border size
|
||||||
|
wxClientDC dc(this);
|
||||||
|
dc.SetFont(GetFont());
|
||||||
|
|
||||||
|
wxCoord y;
|
||||||
|
dc.GetTextExtent(_T("X"), NULL, &y );
|
||||||
|
|
||||||
|
int height = (int)( (11*y)/10 + 2*GetBorderY());
|
||||||
|
|
||||||
|
SetSize(-1, -1, -1, height);
|
||||||
|
|
||||||
return success;
|
return success;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -104,12 +109,6 @@ void wxStatusBarGeneric::SetFieldsCount(int number, const int *widths)
|
|||||||
|
|
||||||
delete[] m_statusStrings;
|
delete[] m_statusStrings;
|
||||||
m_statusStrings = new wxString[number];
|
m_statusStrings = new wxString[number];
|
||||||
|
|
||||||
#if 0 // VZ: what is this for?
|
|
||||||
int i;
|
|
||||||
for (i = 0; i < number; i++)
|
|
||||||
m_statusStrings[i] = "";
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
SetStatusWidths(number, widths);
|
SetStatusWidths(number, widths);
|
||||||
|
@@ -231,17 +231,6 @@ wxStatusBar *wxFrameMSW::OnCreateStatusBar(int number,
|
|||||||
statusBar = new wxStatusBar(this, id, style, name);
|
statusBar = new wxStatusBar(this, id, style, name);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set the height according to the font and the border size
|
|
||||||
wxClientDC dc(statusBar);
|
|
||||||
dc.SetFont(statusBar->GetFont());
|
|
||||||
|
|
||||||
wxCoord y;
|
|
||||||
dc.GetTextExtent(_T("X"), NULL, &y );
|
|
||||||
|
|
||||||
int height = (int)( (11*y)/10 + 2*statusBar->GetBorderY());
|
|
||||||
|
|
||||||
statusBar->SetSize(-1, -1, -1, height);
|
|
||||||
|
|
||||||
statusBar->SetFieldsCount(number);
|
statusBar->SetFieldsCount(number);
|
||||||
|
|
||||||
return statusBar;
|
return statusBar;
|
||||||
|
@@ -45,7 +45,6 @@
|
|||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxStatusBar95, wxWindow);
|
IMPLEMENT_DYNAMIC_CLASS(wxStatusBar95, wxWindow);
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxStatusBar, wxStatusBar95)
|
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
// macros
|
// macros
|
||||||
@@ -127,7 +126,6 @@ bool wxStatusBar95::Create(wxWindow *parent,
|
|||||||
|
|
||||||
wxStatusBar95::~wxStatusBar95()
|
wxStatusBar95::~wxStatusBar95()
|
||||||
{
|
{
|
||||||
delete [] m_statusWidths;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxStatusBar95::CopyFieldsWidth(const int widths[])
|
void wxStatusBar95::CopyFieldsWidth(const int widths[])
|
||||||
|
@@ -2562,7 +2562,10 @@ long wxWindowMSW::MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lParam
|
|||||||
break;
|
break;
|
||||||
#endif // __WIN32__
|
#endif // __WIN32__
|
||||||
|
|
||||||
#ifdef __WXUNIVERSAL__
|
// unfortunately this doesn't really work as then window which
|
||||||
|
// doesn't accept focus doesn't get any mouse events neither which
|
||||||
|
// means it can't get any input at all
|
||||||
|
#if 0 //def __WXUNIVERSAL__
|
||||||
case WM_NCHITTEST:
|
case WM_NCHITTEST:
|
||||||
// we shouldn't allow the windows which don't want to get focus to
|
// we shouldn't allow the windows which don't want to get focus to
|
||||||
// get it
|
// get it
|
||||||
|
@@ -77,7 +77,7 @@ void wxFrame::OnSize(wxSizeEvent& event)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void wxFrame::SendSizeEvent()
|
void wxFrame::SendSizeEvent()
|
||||||
{
|
{
|
||||||
wxSizeEvent event(GetSize(), GetId());
|
wxSizeEvent event(GetSize(), GetId());
|
||||||
event.SetEventObject(this);
|
event.SetEventObject(this);
|
||||||
GetEventHandler()->ProcessEvent(event);
|
GetEventHandler()->ProcessEvent(event);
|
||||||
@@ -117,9 +117,8 @@ void wxFrame::PositionStatusBar()
|
|||||||
{
|
{
|
||||||
if ( m_frameStatusBar )
|
if ( m_frameStatusBar )
|
||||||
{
|
{
|
||||||
wxCoord heightBar = m_frameStatusBar->GetSize().y;
|
wxSize size = GetClientSize();
|
||||||
m_frameStatusBar->SetSize(0, GetClientSize().y,
|
m_frameStatusBar->SetSize(0, size.y, size.x, -1);
|
||||||
GetClientSize().x, heightBar);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
283
src/univ/statusbr.cpp
Normal file
283
src/univ/statusbr.cpp
Normal file
@@ -0,0 +1,283 @@
|
|||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Name: univ/statusbr.cpp
|
||||||
|
// Purpose: wxStatusBar implementation
|
||||||
|
// Author: Vadim Zeitlin
|
||||||
|
// Modified by:
|
||||||
|
// Created: 14.10.01
|
||||||
|
// RCS-ID: $Id$
|
||||||
|
// Copyright: (c) 2000 SciTech Software, Inc. (www.scitechsoft.com)
|
||||||
|
// Licence: wxWindows license
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
// ============================================================================
|
||||||
|
// declarations
|
||||||
|
// ============================================================================
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
// headers
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
#ifdef __GNUG__
|
||||||
|
#pragma implementation "univstatusbr.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include "wx/wxprec.h"
|
||||||
|
|
||||||
|
#ifdef __BORLANDC__
|
||||||
|
#pragma hdrstop
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if wxUSE_STATUSBAR
|
||||||
|
|
||||||
|
#ifndef WX_PRECOMP
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include "wx/statusbr.h"
|
||||||
|
|
||||||
|
#include "wx/univ/renderer.h"
|
||||||
|
|
||||||
|
// ============================================================================
|
||||||
|
// implementation
|
||||||
|
// ============================================================================
|
||||||
|
|
||||||
|
BEGIN_EVENT_TABLE(wxStatusBarUniv, wxStatusBarBase)
|
||||||
|
EVT_SIZE(wxStatusBarUniv::OnSize)
|
||||||
|
|
||||||
|
WX_EVENT_TABLE_INPUT_CONSUMER(wxStatusBarUniv)
|
||||||
|
END_EVENT_TABLE()
|
||||||
|
|
||||||
|
WX_FORWARD_TO_INPUT_CONSUMER(wxStatusBarUniv)
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
// creation
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
void wxStatusBarUniv::Init()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
bool wxStatusBarUniv::Create(wxWindow *parent,
|
||||||
|
wxWindowID id,
|
||||||
|
long style,
|
||||||
|
const wxString& name)
|
||||||
|
{
|
||||||
|
if ( !wxWindow::Create(parent, id,
|
||||||
|
wxDefaultPosition, wxDefaultSize,
|
||||||
|
style, name) )
|
||||||
|
{
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
SetFieldsCount(1);
|
||||||
|
|
||||||
|
CreateInputHandler(wxINP_HANDLER_STATUSBAR);
|
||||||
|
|
||||||
|
SetSize(DoGetBestSize());
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
// drawing
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
wxRect wxStatusBarUniv::GetTotalFieldRect(wxCoord *borderBetweenFields)
|
||||||
|
{
|
||||||
|
// determine the space we have for the fields
|
||||||
|
wxSize sizeBorders = m_renderer->GetStatusBarBorders(borderBetweenFields);
|
||||||
|
|
||||||
|
wxRect rect = GetClientRect();
|
||||||
|
|
||||||
|
// no, don't do this - the borders are meant to be inside this rect
|
||||||
|
//rect.Deflate(sizeBorders.x, sizeBorders.y);
|
||||||
|
|
||||||
|
// recalc the field widths if needed
|
||||||
|
if ( m_widthsAbs.IsEmpty() )
|
||||||
|
{
|
||||||
|
// the total width for the fields doesn't include the borders between
|
||||||
|
// them
|
||||||
|
m_widthsAbs = CalculateAbsWidths(rect.width -
|
||||||
|
*borderBetweenFields*(m_nFields - 1));
|
||||||
|
}
|
||||||
|
|
||||||
|
return rect;
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxStatusBarUniv::DoDraw(wxControlRenderer *renderer)
|
||||||
|
{
|
||||||
|
// get the fields rect
|
||||||
|
wxCoord borderBetweenFields;
|
||||||
|
wxRect rect = GetTotalFieldRect(&borderBetweenFields);
|
||||||
|
|
||||||
|
// prepare the DC
|
||||||
|
wxDC& dc = renderer->GetDC();
|
||||||
|
dc.SetFont(wxSystemSettings::GetSystemFont(wxSYS_DEFAULT_GUI_FONT));
|
||||||
|
|
||||||
|
// do draw the fields
|
||||||
|
int flags = IsEnabled() ? 0 : wxCONTROL_DISABLED;
|
||||||
|
for ( int n = 0; n < m_nFields; n++ )
|
||||||
|
{
|
||||||
|
rect.width = m_widthsAbs[n];
|
||||||
|
|
||||||
|
if ( IsExposed(rect) )
|
||||||
|
{
|
||||||
|
// the size grip may be drawn only on the last field and only if we
|
||||||
|
// have the corresponding style and even then only if we really can
|
||||||
|
// resize this frame
|
||||||
|
if ( n == m_nFields - 1 &&
|
||||||
|
HasFlag(wxST_SIZEGRIP) &&
|
||||||
|
GetParent()->HasFlag(wxRESIZE_BORDER) )
|
||||||
|
{
|
||||||
|
// NB: we use wxCONTROL_ISDEFAULT for this because it doesn't
|
||||||
|
// have any meaning for the status bar otherwise anyhow
|
||||||
|
// (it's still ugly, of course, but there are too few flags
|
||||||
|
// to squander them for things like this)
|
||||||
|
flags |= wxCONTROL_ISDEFAULT;
|
||||||
|
}
|
||||||
|
|
||||||
|
m_renderer->DrawStatusField(dc, rect, m_statusText[n], flags);
|
||||||
|
}
|
||||||
|
|
||||||
|
rect.x += rect.width + borderBetweenFields;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxStatusBarUniv::RefreshField(int i)
|
||||||
|
{
|
||||||
|
wxRect rect;
|
||||||
|
if ( GetFieldRect(i, rect) )
|
||||||
|
{
|
||||||
|
RefreshRect(rect);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
// fields text
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
void wxStatusBarUniv::SetStatusText(const wxString& text, int number)
|
||||||
|
{
|
||||||
|
wxCHECK_RET( number >= 0 && number < m_nFields,
|
||||||
|
_T("invalid status bar field index in SetStatusText()") );
|
||||||
|
|
||||||
|
if ( text == m_statusText[number] )
|
||||||
|
{
|
||||||
|
// nothing changed
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
m_statusText[number] = text;
|
||||||
|
|
||||||
|
RefreshField(number);
|
||||||
|
}
|
||||||
|
|
||||||
|
wxString wxStatusBarUniv::GetStatusText(int number) const
|
||||||
|
{
|
||||||
|
wxCHECK_MSG( number >= 0 && number < m_nFields, _T(""),
|
||||||
|
_T("invalid status bar field index") );
|
||||||
|
|
||||||
|
return m_statusText[number];
|
||||||
|
}
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
// fields count/widths
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
void wxStatusBarUniv::SetFieldsCount(int number, const int *widths)
|
||||||
|
{
|
||||||
|
wxStatusBarBase::SetFieldsCount(number, widths);
|
||||||
|
|
||||||
|
m_statusText.SetCount(number);
|
||||||
|
m_widthsAbs.Empty();
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxStatusBarUniv::SetStatusWidths(int n, const int widths[])
|
||||||
|
{
|
||||||
|
wxStatusBarBase::SetStatusWidths(n, widths);
|
||||||
|
|
||||||
|
m_widthsAbs.Empty();
|
||||||
|
}
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
// geometry
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
void wxStatusBarUniv::OnSize(wxSizeEvent& event)
|
||||||
|
{
|
||||||
|
// invalidate the widths, we'll have to recalc them
|
||||||
|
m_widthsAbs.Empty();
|
||||||
|
|
||||||
|
// refresh entirely, shouldn't matter much as the statusbar is quick to
|
||||||
|
// redraw and it would be difficult to avoid it as we'd need to find out
|
||||||
|
// which fields exactly were affected...
|
||||||
|
Refresh();
|
||||||
|
|
||||||
|
event.Skip();
|
||||||
|
}
|
||||||
|
|
||||||
|
bool wxStatusBarUniv::GetFieldRect(int n, wxRect& rect) const
|
||||||
|
{
|
||||||
|
wxCHECK_MSG( n >= 0 && n < m_nFields, FALSE,
|
||||||
|
_T("invalid field index in GetFieldRect()") );
|
||||||
|
|
||||||
|
// this is a fix for a bug exhibited by the statbar sample: if
|
||||||
|
// GetFieldRect() is called from the derived class OnSize() handler, then
|
||||||
|
// our geometry info is wrong as our OnSize() didn't invalidate m_widthsAbs
|
||||||
|
// yet - so recalc it just in case
|
||||||
|
wxStatusBarUniv *self = wxConstCast(this, wxStatusBarUniv);
|
||||||
|
self->m_widthsAbs.Empty();
|
||||||
|
|
||||||
|
wxCoord borderBetweenFields;
|
||||||
|
rect = self->GetTotalFieldRect(&borderBetweenFields);
|
||||||
|
for ( int i = 0; i <= n; i++ )
|
||||||
|
{
|
||||||
|
rect.width = m_widthsAbs[i];
|
||||||
|
|
||||||
|
if ( i < n )
|
||||||
|
rect.x += rect.width + borderBetweenFields;
|
||||||
|
}
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
wxCoord wxStatusBarUniv::GetHeight() const
|
||||||
|
{
|
||||||
|
wxClientDC dc(wxConstCast(this, wxStatusBarUniv));
|
||||||
|
dc.SetFont(wxSystemSettings::GetSystemFont(wxSYS_DEFAULT_GUI_FONT));
|
||||||
|
|
||||||
|
return dc.GetCharHeight() + 2*GetBorderY();
|
||||||
|
}
|
||||||
|
|
||||||
|
wxSize wxStatusBarUniv::DoGetBestSize() const
|
||||||
|
{
|
||||||
|
return wxSize(100, GetHeight());
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxStatusBarUniv::DoSetSize(int x, int y,
|
||||||
|
int width, int WXUNUSED(height),
|
||||||
|
int sizeFlags)
|
||||||
|
{
|
||||||
|
wxStatusBarBase::DoSetSize(x, y, width, GetHeight(), sizeFlags);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
// misc
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
void wxStatusBarUniv::SetMinHeight(int WXUNUSED(height))
|
||||||
|
{
|
||||||
|
// nothing to do here, we don't support it - and why would we?
|
||||||
|
}
|
||||||
|
|
||||||
|
int wxStatusBarUniv::GetBorderX() const
|
||||||
|
{
|
||||||
|
return m_renderer->GetStatusBarBorders(NULL).x;
|
||||||
|
}
|
||||||
|
|
||||||
|
int wxStatusBarUniv::GetBorderY() const
|
||||||
|
{
|
||||||
|
return m_renderer->GetStatusBarBorders(NULL).y;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif // wxUSE_STATUSBAR
|
||||||
|
|
@@ -188,7 +188,6 @@ public:
|
|||||||
// we don't have the ticks in GTK version
|
// we don't have the ticks in GTK version
|
||||||
}
|
}
|
||||||
|
|
||||||
#if wxUSE_MENUS
|
|
||||||
virtual void DrawMenuBarItem(wxDC& dc,
|
virtual void DrawMenuBarItem(wxDC& dc,
|
||||||
const wxRect& rect,
|
const wxRect& rect,
|
||||||
const wxString& label,
|
const wxString& label,
|
||||||
@@ -205,7 +204,11 @@ public:
|
|||||||
virtual void DrawMenuSeparator(wxDC& dc,
|
virtual void DrawMenuSeparator(wxDC& dc,
|
||||||
wxCoord y,
|
wxCoord y,
|
||||||
const wxMenuGeometryInfo& geomInfo);
|
const wxMenuGeometryInfo& geomInfo);
|
||||||
#endif
|
|
||||||
|
virtual void DrawStatusField(wxDC& dc,
|
||||||
|
const wxRect& rect,
|
||||||
|
const wxString& label,
|
||||||
|
int flags = 0);
|
||||||
|
|
||||||
virtual void DrawFrameTitleBar(wxDC& dc,
|
virtual void DrawFrameTitleBar(wxDC& dc,
|
||||||
const wxRect& rect,
|
const wxRect& rect,
|
||||||
@@ -285,12 +288,13 @@ public:
|
|||||||
virtual wxSize GetSliderThumbSize(const wxRect& rect,
|
virtual wxSize GetSliderThumbSize(const wxRect& rect,
|
||||||
wxOrientation orient) const;
|
wxOrientation orient) const;
|
||||||
virtual wxSize GetProgressBarStep() const { return wxSize(16, 32); }
|
virtual wxSize GetProgressBarStep() const { return wxSize(16, 32); }
|
||||||
#if wxUSE_MENUS
|
|
||||||
|
|
||||||
virtual wxSize GetMenuBarItemSize(const wxSize& sizeText) const;
|
virtual wxSize GetMenuBarItemSize(const wxSize& sizeText) const;
|
||||||
virtual wxMenuGeometryInfo *GetMenuGeometry(wxWindow *win,
|
virtual wxMenuGeometryInfo *GetMenuGeometry(wxWindow *win,
|
||||||
const wxMenu& menu) const;
|
const wxMenu& menu) const;
|
||||||
#endif
|
|
||||||
|
virtual wxSize GetStatusBarBorders(wxCoord *borderBetweenFields) const;
|
||||||
|
|
||||||
// helpers for "wxBitmap wxColourScheme::Get()"
|
// helpers for "wxBitmap wxColourScheme::Get()"
|
||||||
void DrawCheckBitmap(wxDC& dc, const wxRect& rect);
|
void DrawCheckBitmap(wxDC& dc, const wxRect& rect);
|
||||||
void DrawUncheckBitmap(wxDC& dc, const wxRect& rect, bool isPressed);
|
void DrawUncheckBitmap(wxDC& dc, const wxRect& rect, bool isPressed);
|
||||||
@@ -1817,7 +1821,6 @@ void wxGTKRenderer::DrawSliderThumb(wxDC& dc,
|
|||||||
DrawShadedRect(dc, &rect, m_penDarkGrey, m_penHighlight);
|
DrawShadedRect(dc, &rect, m_penDarkGrey, m_penHighlight);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if wxUSE_MENUS
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
// menu and menubar
|
// menu and menubar
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
@@ -1862,7 +1865,22 @@ wxMenuGeometryInfo *wxGTKRenderer::GetMenuGeometry(wxWindow *win,
|
|||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
#endif // wxUSE_MENUS
|
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
// status bar
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
wxSize wxGTKRenderer::GetStatusBarBorders(wxCoord *borderBetweenFields) const
|
||||||
|
{
|
||||||
|
return wxSize(0, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxGTKRenderer::DrawStatusField(wxDC& dc,
|
||||||
|
const wxRect& rect,
|
||||||
|
const wxString& label,
|
||||||
|
int flags)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
// combobox
|
// combobox
|
||||||
|
@@ -73,6 +73,11 @@ static const int FRAME_TITLEBAR_HEIGHT = 18;
|
|||||||
static const int FRAME_BUTTON_WIDTH = 16;
|
static const int FRAME_BUTTON_WIDTH = 16;
|
||||||
static const int FRAME_BUTTON_HEIGHT = 14;
|
static const int FRAME_BUTTON_HEIGHT = 14;
|
||||||
|
|
||||||
|
static const size_t NUM_STATUSBAR_GRIP_BANDS = 3;
|
||||||
|
static const size_t WIDTH_STATUSBAR_GRIP_BAND = 4;
|
||||||
|
static const size_t STATUSBAR_GRIP_SIZE =
|
||||||
|
WIDTH_STATUSBAR_GRIP_BAND*NUM_STATUSBAR_GRIP_BANDS;
|
||||||
|
|
||||||
enum IndicatorType
|
enum IndicatorType
|
||||||
{
|
{
|
||||||
IndicatorType_Check,
|
IndicatorType_Check,
|
||||||
@@ -255,7 +260,6 @@ public:
|
|||||||
int end,
|
int end,
|
||||||
int step = 1,
|
int step = 1,
|
||||||
int flags = 0);
|
int flags = 0);
|
||||||
#if wxUSE_MENUS
|
|
||||||
|
|
||||||
virtual void DrawMenuBarItem(wxDC& dc,
|
virtual void DrawMenuBarItem(wxDC& dc,
|
||||||
const wxRect& rect,
|
const wxRect& rect,
|
||||||
@@ -273,7 +277,12 @@ public:
|
|||||||
virtual void DrawMenuSeparator(wxDC& dc,
|
virtual void DrawMenuSeparator(wxDC& dc,
|
||||||
wxCoord y,
|
wxCoord y,
|
||||||
const wxMenuGeometryInfo& geomInfo);
|
const wxMenuGeometryInfo& geomInfo);
|
||||||
#endif
|
|
||||||
|
virtual void DrawStatusField(wxDC& dc,
|
||||||
|
const wxRect& rect,
|
||||||
|
const wxString& label,
|
||||||
|
int flags = 0);
|
||||||
|
|
||||||
// titlebars
|
// titlebars
|
||||||
virtual void DrawFrameTitleBar(wxDC& dc,
|
virtual void DrawFrameTitleBar(wxDC& dc,
|
||||||
const wxRect& rect,
|
const wxRect& rect,
|
||||||
@@ -351,11 +360,12 @@ public:
|
|||||||
wxOrientation orient) const;
|
wxOrientation orient) const;
|
||||||
virtual wxSize GetProgressBarStep() const { return wxSize(16, 32); }
|
virtual wxSize GetProgressBarStep() const { return wxSize(16, 32); }
|
||||||
|
|
||||||
#if wxUSE_MENUS
|
|
||||||
virtual wxSize GetMenuBarItemSize(const wxSize& sizeText) const;
|
virtual wxSize GetMenuBarItemSize(const wxSize& sizeText) const;
|
||||||
virtual wxMenuGeometryInfo *GetMenuGeometry(wxWindow *win,
|
virtual wxMenuGeometryInfo *GetMenuGeometry(wxWindow *win,
|
||||||
const wxMenu& menu) const;
|
const wxMenu& menu) const;
|
||||||
#endif
|
|
||||||
|
virtual wxSize GetStatusBarBorders(wxCoord *borderBetweenFields) const;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// helper of DrawLabel() and DrawCheckOrRadioButton()
|
// helper of DrawLabel() and DrawCheckOrRadioButton()
|
||||||
void DoDrawLabel(wxDC& dc,
|
void DoDrawLabel(wxDC& dc,
|
||||||
@@ -459,9 +469,9 @@ private:
|
|||||||
m_penDarkGrey,
|
m_penDarkGrey,
|
||||||
m_penLightGrey,
|
m_penLightGrey,
|
||||||
m_penHighlight;
|
m_penHighlight;
|
||||||
|
|
||||||
wxFont m_titlebarFont;
|
wxFont m_titlebarFont;
|
||||||
|
|
||||||
// titlebar icons:
|
// titlebar icons:
|
||||||
wxBitmap m_bmpFrameButtons[FrameButton_Max];
|
wxBitmap m_bmpFrameButtons[FrameButton_Max];
|
||||||
|
|
||||||
@@ -542,6 +552,29 @@ public:
|
|||||||
bool pressed);
|
bool pressed);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class wxWin32StatusBarInputHandler : public wxStdInputHandler
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
wxWin32StatusBarInputHandler(wxInputHandler *handler);
|
||||||
|
|
||||||
|
virtual bool HandleMouse(wxInputConsumer *consumer,
|
||||||
|
const wxMouseEvent& event);
|
||||||
|
|
||||||
|
virtual bool HandleMouseMove(wxInputConsumer *consumer,
|
||||||
|
const wxMouseEvent& event);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
// is the given point over the statusbar grip?
|
||||||
|
bool IsOnGrip(wxWindow *statbar, const wxPoint& pt) const;
|
||||||
|
|
||||||
|
private:
|
||||||
|
// the cursor we had replaced with the resize one
|
||||||
|
wxCursor m_cursorOld;
|
||||||
|
|
||||||
|
// was the mouse over the grip last time we checked?
|
||||||
|
bool m_isOnGrip;
|
||||||
|
};
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
// wxWin32ColourScheme: uses (default) Win32 colours
|
// wxWin32ColourScheme: uses (default) Win32 colours
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
@@ -1152,6 +1185,10 @@ wxInputHandler *wxWin32Theme::GetInputHandler(const wxString& control)
|
|||||||
else if ( control == wxINP_HANDLER_NOTEBOOK )
|
else if ( control == wxINP_HANDLER_NOTEBOOK )
|
||||||
handler = new wxStdNotebookInputHandler(GetDefaultInputHandler());
|
handler = new wxStdNotebookInputHandler(GetDefaultInputHandler());
|
||||||
#endif // wxUSE_NOTEBOOK
|
#endif // wxUSE_NOTEBOOK
|
||||||
|
#if wxUSE_STATUSBAR
|
||||||
|
else if ( control == wxINP_HANDLER_STATUSBAR )
|
||||||
|
handler = new wxWin32StatusBarInputHandler(GetDefaultInputHandler());
|
||||||
|
#endif // wxUSE_STATUSBAR
|
||||||
else if ( control == wxINP_HANDLER_TOPLEVEL )
|
else if ( control == wxINP_HANDLER_TOPLEVEL )
|
||||||
handler = new wxStdFrameInputHandler(GetDefaultInputHandler());
|
handler = new wxStdFrameInputHandler(GetDefaultInputHandler());
|
||||||
else
|
else
|
||||||
@@ -1254,7 +1291,7 @@ wxColour wxWin32ColourScheme::Get(wxWin32ColourScheme::StdColour col) const
|
|||||||
|
|
||||||
case CONTROL_TEXT_DISABLED_SHADOW:
|
case CONTROL_TEXT_DISABLED_SHADOW:
|
||||||
case SHADOW_OUT: return wxColour(GetSysColor(COLOR_BTNSHADOW));
|
case SHADOW_OUT: return wxColour(GetSysColor(COLOR_BTNSHADOW));
|
||||||
|
|
||||||
case TITLEBAR: return wxColour(GetSysColor(COLOR_INACTIVECAPTION));
|
case TITLEBAR: return wxColour(GetSysColor(COLOR_INACTIVECAPTION));
|
||||||
case TITLEBAR_ACTIVE: return wxColour(GetSysColor(COLOR_ACTIVECAPTION));
|
case TITLEBAR_ACTIVE: return wxColour(GetSysColor(COLOR_ACTIVECAPTION));
|
||||||
case TITLEBAR_TEXT: return wxColour(GetSysColor(COLOR_CAPTIONTEXT));
|
case TITLEBAR_TEXT: return wxColour(GetSysColor(COLOR_CAPTIONTEXT));
|
||||||
@@ -1320,7 +1357,7 @@ wxWin32Renderer::wxWin32Renderer(const wxColourScheme *scheme)
|
|||||||
|
|
||||||
m_colHighlight = wxSCHEME_COLOUR(scheme, SHADOW_HIGHLIGHT);
|
m_colHighlight = wxSCHEME_COLOUR(scheme, SHADOW_HIGHLIGHT);
|
||||||
m_penHighlight = wxPen(m_colHighlight, 0, wxSOLID);
|
m_penHighlight = wxPen(m_colHighlight, 0, wxSOLID);
|
||||||
|
|
||||||
m_titlebarFont = wxSystemSettings::GetSystemFont(wxSYS_DEFAULT_GUI_FONT);
|
m_titlebarFont = wxSystemSettings::GetSystemFont(wxSYS_DEFAULT_GUI_FONT);
|
||||||
m_titlebarFont.SetWeight(wxFONTWEIGHT_BOLD);
|
m_titlebarFont.SetWeight(wxFONTWEIGHT_BOLD);
|
||||||
|
|
||||||
@@ -1493,7 +1530,7 @@ wxWin32Renderer::wxWin32Renderer(const wxColourScheme *scheme)
|
|||||||
|
|
||||||
m_bmpArrows[Arrow_Pressed][n] = m_bmpArrows[Arrow_Normal][n];
|
m_bmpArrows[Arrow_Pressed][n] = m_bmpArrows[Arrow_Normal][n];
|
||||||
}
|
}
|
||||||
|
|
||||||
// init the frame buttons bitmaps
|
// init the frame buttons bitmaps
|
||||||
m_bmpFrameButtons[FrameButton_Close] = wxBitmap(frame_button_close_xpm);
|
m_bmpFrameButtons[FrameButton_Close] = wxBitmap(frame_button_close_xpm);
|
||||||
m_bmpFrameButtons[FrameButton_Minimize] = wxBitmap(frame_button_minimize_xpm);
|
m_bmpFrameButtons[FrameButton_Minimize] = wxBitmap(frame_button_minimize_xpm);
|
||||||
@@ -2599,8 +2636,6 @@ void wxWin32Renderer::DrawSliderTicks(wxDC& dc,
|
|||||||
// menu and menubar
|
// menu and menubar
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
#if wxUSE_MENUS
|
|
||||||
|
|
||||||
// wxWin32MenuGeometryInfo: the wxMenuGeometryInfo used by wxWin32Renderer
|
// wxWin32MenuGeometryInfo: the wxMenuGeometryInfo used by wxWin32Renderer
|
||||||
class WXDLLEXPORT wxWin32MenuGeometryInfo : public wxMenuGeometryInfo
|
class WXDLLEXPORT wxWin32MenuGeometryInfo : public wxMenuGeometryInfo
|
||||||
{
|
{
|
||||||
@@ -2625,12 +2660,10 @@ private:
|
|||||||
// the height of a normal (not separator) item
|
// the height of a normal (not separator) item
|
||||||
wxCoord m_heightItem;
|
wxCoord m_heightItem;
|
||||||
|
|
||||||
friend wxMenuGeometryInfo *wxWin32Renderer::
|
friend wxMenuGeometryInfo *
|
||||||
GetMenuGeometry(wxWindow *, const wxMenu&) const;
|
wxWin32Renderer::GetMenuGeometry(wxWindow *, const wxMenu&) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // wxUSE_MENUS
|
|
||||||
|
|
||||||
// FIXME: all constants are hardcoded but shouldn't be
|
// FIXME: all constants are hardcoded but shouldn't be
|
||||||
static const wxCoord MENU_LEFT_MARGIN = 9;
|
static const wxCoord MENU_LEFT_MARGIN = 9;
|
||||||
static const wxCoord MENU_RIGHT_MARGIN = 18;
|
static const wxCoord MENU_RIGHT_MARGIN = 18;
|
||||||
@@ -2650,10 +2683,6 @@ static const wxCoord MENU_SEPARATOR_HEIGHT = 3;
|
|||||||
// the size of the standard checkmark bitmap
|
// the size of the standard checkmark bitmap
|
||||||
static const wxCoord MENU_CHECK_SIZE = 9;
|
static const wxCoord MENU_CHECK_SIZE = 9;
|
||||||
|
|
||||||
// we can't implement these methods without wxMenuGeometryInfo implementation
|
|
||||||
// which we don't have if !wxUSE_MENUS
|
|
||||||
#if wxUSE_MENUS
|
|
||||||
|
|
||||||
void wxWin32Renderer::DrawMenuBarItem(wxDC& dc,
|
void wxWin32Renderer::DrawMenuBarItem(wxDC& dc,
|
||||||
const wxRect& rectOrig,
|
const wxRect& rectOrig,
|
||||||
const wxString& label,
|
const wxString& label,
|
||||||
@@ -2865,48 +2894,81 @@ wxMenuGeometryInfo *wxWin32Renderer::GetMenuGeometry(wxWindow *win,
|
|||||||
return gi;
|
return gi;
|
||||||
}
|
}
|
||||||
|
|
||||||
#else // !wxUSE_MENUS
|
// ----------------------------------------------------------------------------
|
||||||
|
// status bar
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
/*
|
static const wxCoord STATBAR_BORDER_X = 2;
|
||||||
void wxWin32Renderer::DrawMenuBarItem(wxDC& WXUNUSED(dc),
|
static const wxCoord STATBAR_BORDER_Y = 2;
|
||||||
const wxRect& WXUNUSED(rectOrig),
|
|
||||||
const wxString& WXUNUSED(label),
|
wxSize wxWin32Renderer::GetStatusBarBorders(wxCoord *borderBetweenFields) const
|
||||||
int WXUNUSED(flags),
|
|
||||||
int WXUNUSED(indexAccel))
|
|
||||||
{
|
{
|
||||||
|
if ( borderBetweenFields )
|
||||||
|
*borderBetweenFields = 2;
|
||||||
|
|
||||||
|
return wxSize(STATBAR_BORDER_X, STATBAR_BORDER_Y);
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxWin32Renderer::DrawMenuItem(wxDC& WXUNUSED(dc),
|
void wxWin32Renderer::DrawStatusField(wxDC& dc,
|
||||||
wxCoord WXUNUSED(y),
|
const wxRect& rect,
|
||||||
const wxMenuGeometryInfo& WXUNUSED(gi),
|
const wxString& label,
|
||||||
const wxString& WXUNUSED(label),
|
int flags)
|
||||||
const wxString& WXUNUSED(accel),
|
|
||||||
const wxBitmap& WXUNUSED(bitmap),
|
|
||||||
int WXUNUSED(flags),
|
|
||||||
int WXUNUSED(indexAccel))
|
|
||||||
{
|
{
|
||||||
}
|
wxRect rectIn;
|
||||||
|
|
||||||
void wxWin32Renderer::DrawMenuSeparator(wxDC& WXUNUSED(dc),
|
if ( flags & wxCONTROL_ISDEFAULT )
|
||||||
wxCoord WXUNUSED(y),
|
{
|
||||||
const wxMenuGeometryInfo& WXUNUSED(gi))
|
// draw the size grip: it is a normal rect except that in the lower
|
||||||
{
|
// right corner we have several bands which may be used for dragging
|
||||||
}
|
// the status bar corner
|
||||||
|
//
|
||||||
|
// each band consists of 4 stripes: m_penHighlight, double
|
||||||
|
// m_penDarkGrey and transparent one
|
||||||
|
wxCoord x2 = rect.GetRight(),
|
||||||
|
y2 = rect.GetBottom();
|
||||||
|
|
||||||
wxSize wxWin32Renderer::GetMenuBarItemSize(const wxSize& size) const
|
// draw the upper left part of the rect normally
|
||||||
{
|
dc.SetPen(m_penDarkGrey);
|
||||||
return size;
|
dc.DrawLine(rect.GetLeft(), rect.GetTop(), rect.GetLeft(), y2);
|
||||||
}
|
dc.DrawLine(rect.GetLeft() + 1, rect.GetTop(), x2, rect.GetTop());
|
||||||
|
|
||||||
wxMenuGeometryInfo *
|
// draw the grey stripes of the grip
|
||||||
wxWin32Renderer::GetMenuGeometry(wxWindow *WXUNUSED(win),
|
size_t n;
|
||||||
const wxMenu& WXUNUSED(menu)) const
|
wxCoord ofs = WIDTH_STATUSBAR_GRIP_BAND - 1;
|
||||||
{
|
for ( n = 0; n < NUM_STATUSBAR_GRIP_BANDS; n++, ofs += WIDTH_STATUSBAR_GRIP_BAND )
|
||||||
return NULL;
|
{
|
||||||
}
|
dc.DrawLine(x2 - ofs + 1, y2 - 1, x2, y2 - ofs);
|
||||||
*/
|
dc.DrawLine(x2 - ofs, y2 - 1, x2, y2 - ofs - 1);
|
||||||
|
}
|
||||||
|
|
||||||
#endif // wxUSE_MENUS/!wxUSE_MENUS
|
// draw the white stripes
|
||||||
|
dc.SetPen(m_penHighlight);
|
||||||
|
ofs = WIDTH_STATUSBAR_GRIP_BAND + 1;
|
||||||
|
for ( n = 0; n < NUM_STATUSBAR_GRIP_BANDS; n++, ofs += WIDTH_STATUSBAR_GRIP_BAND )
|
||||||
|
{
|
||||||
|
dc.DrawLine(x2 - ofs + 1, y2 - 1, x2, y2 - ofs);
|
||||||
|
}
|
||||||
|
|
||||||
|
// draw the remaining rect boundaries
|
||||||
|
ofs -= WIDTH_STATUSBAR_GRIP_BAND;
|
||||||
|
dc.DrawLine(x2, rect.GetTop(), x2, y2 - ofs + 1);
|
||||||
|
dc.DrawLine(rect.GetLeft(), y2, x2 - ofs + 1, y2);
|
||||||
|
|
||||||
|
rectIn = rect;
|
||||||
|
rectIn.Deflate(1);
|
||||||
|
|
||||||
|
rectIn.width -= STATUSBAR_GRIP_SIZE;
|
||||||
|
}
|
||||||
|
else // normal pane
|
||||||
|
{
|
||||||
|
DrawBorder(dc, wxBORDER_STATIC, rect, flags, &rectIn);
|
||||||
|
}
|
||||||
|
|
||||||
|
rectIn.Deflate(STATBAR_BORDER_X, STATBAR_BORDER_Y);
|
||||||
|
|
||||||
|
wxDCClipper clipper(dc, rectIn);
|
||||||
|
DrawLabel(dc, label, rectIn, flags, wxALIGN_LEFT | wxALIGN_CENTRE_VERTICAL);
|
||||||
|
}
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
// combobox
|
// combobox
|
||||||
@@ -3104,10 +3166,10 @@ int wxWin32Renderer::PixelToScrollbar(const wxScrollBar *scrollbar,
|
|||||||
int wxWin32Renderer::HitTestFrame(const wxRect& rect, const wxPoint& pt, int flags) const
|
int wxWin32Renderer::HitTestFrame(const wxRect& rect, const wxPoint& pt, int flags) const
|
||||||
{
|
{
|
||||||
wxRect client = GetFrameClientArea(rect, flags);
|
wxRect client = GetFrameClientArea(rect, flags);
|
||||||
|
|
||||||
if ( client.Inside(pt) )
|
if ( client.Inside(pt) )
|
||||||
return wxHT_TOPLEVEL_CLIENT_AREA;
|
return wxHT_TOPLEVEL_CLIENT_AREA;
|
||||||
|
|
||||||
if ( flags & wxTOPLEVEL_TITLEBAR )
|
if ( flags & wxTOPLEVEL_TITLEBAR )
|
||||||
{
|
{
|
||||||
wxRect client = GetFrameClientArea(rect, flags & ~wxTOPLEVEL_TITLEBAR);
|
wxRect client = GetFrameClientArea(rect, flags & ~wxTOPLEVEL_TITLEBAR);
|
||||||
@@ -3117,11 +3179,11 @@ int wxWin32Renderer::HitTestFrame(const wxRect& rect, const wxPoint& pt, int fla
|
|||||||
if ( wxRect(client.GetPosition(), GetFrameIconSize()).Inside(pt) )
|
if ( wxRect(client.GetPosition(), GetFrameIconSize()).Inside(pt) )
|
||||||
return wxHT_TOPLEVEL_ICON;
|
return wxHT_TOPLEVEL_ICON;
|
||||||
}
|
}
|
||||||
|
|
||||||
wxRect btnRect(client.GetRight() - 2 - FRAME_BUTTON_WIDTH,
|
wxRect btnRect(client.GetRight() - 2 - FRAME_BUTTON_WIDTH,
|
||||||
client.GetTop() + (FRAME_TITLEBAR_HEIGHT-FRAME_BUTTON_HEIGHT)/2,
|
client.GetTop() + (FRAME_TITLEBAR_HEIGHT-FRAME_BUTTON_HEIGHT)/2,
|
||||||
FRAME_BUTTON_WIDTH, FRAME_BUTTON_HEIGHT);
|
FRAME_BUTTON_WIDTH, FRAME_BUTTON_HEIGHT);
|
||||||
|
|
||||||
if ( flags & wxTOPLEVEL_BUTTON_CLOSE )
|
if ( flags & wxTOPLEVEL_BUTTON_CLOSE )
|
||||||
{
|
{
|
||||||
if ( btnRect.Inside(pt) )
|
if ( btnRect.Inside(pt) )
|
||||||
@@ -3160,7 +3222,7 @@ int wxWin32Renderer::HitTestFrame(const wxRect& rect, const wxPoint& pt, int fla
|
|||||||
if ( (flags & wxTOPLEVEL_BORDER) && !(flags & wxTOPLEVEL_MAXIMIZED) )
|
if ( (flags & wxTOPLEVEL_BORDER) && !(flags & wxTOPLEVEL_MAXIMIZED) )
|
||||||
{
|
{
|
||||||
// we are certainly at one of borders, lets decide which one:
|
// we are certainly at one of borders, lets decide which one:
|
||||||
|
|
||||||
int border = 0;
|
int border = 0;
|
||||||
// dirty trick, relies on the way wxHT_TOPLEVEL_XXX are defined!
|
// dirty trick, relies on the way wxHT_TOPLEVEL_XXX are defined!
|
||||||
if ( pt.x < client.x )
|
if ( pt.x < client.x )
|
||||||
@@ -3173,7 +3235,7 @@ int wxWin32Renderer::HitTestFrame(const wxRect& rect, const wxPoint& pt, int fla
|
|||||||
border |= wxHT_TOPLEVEL_BORDER_S;
|
border |= wxHT_TOPLEVEL_BORDER_S;
|
||||||
return border;
|
return border;
|
||||||
}
|
}
|
||||||
|
|
||||||
return wxHT_NOWHERE;
|
return wxHT_NOWHERE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3195,12 +3257,12 @@ void wxWin32Renderer::DrawFrameTitleBar(wxDC& dc,
|
|||||||
if ( flags & wxTOPLEVEL_ICON )
|
if ( flags & wxTOPLEVEL_ICON )
|
||||||
DrawFrameIcon(dc, rect, icon, flags);
|
DrawFrameIcon(dc, rect, icon, flags);
|
||||||
DrawFrameTitle(dc, rect, title, flags);
|
DrawFrameTitle(dc, rect, title, flags);
|
||||||
|
|
||||||
wxRect client = GetFrameClientArea(rect, flags & ~wxTOPLEVEL_TITLEBAR);
|
wxRect client = GetFrameClientArea(rect, flags & ~wxTOPLEVEL_TITLEBAR);
|
||||||
wxCoord x,y;
|
wxCoord x,y;
|
||||||
x = client.GetRight() - 2 - FRAME_BUTTON_WIDTH;
|
x = client.GetRight() - 2 - FRAME_BUTTON_WIDTH;
|
||||||
y = client.GetTop() + (FRAME_TITLEBAR_HEIGHT-FRAME_BUTTON_HEIGHT)/2;
|
y = client.GetTop() + (FRAME_TITLEBAR_HEIGHT-FRAME_BUTTON_HEIGHT)/2;
|
||||||
|
|
||||||
if ( flags & wxTOPLEVEL_BUTTON_CLOSE )
|
if ( flags & wxTOPLEVEL_BUTTON_CLOSE )
|
||||||
{
|
{
|
||||||
DrawFrameButton(dc, x, y, wxTOPLEVEL_BUTTON_CLOSE,
|
DrawFrameButton(dc, x, y, wxTOPLEVEL_BUTTON_CLOSE,
|
||||||
@@ -3244,9 +3306,9 @@ void wxWin32Renderer::DrawFrameBorder(wxDC& dc,
|
|||||||
int flags)
|
int flags)
|
||||||
{
|
{
|
||||||
if ( !(flags & wxTOPLEVEL_BORDER) ) return;
|
if ( !(flags & wxTOPLEVEL_BORDER) ) return;
|
||||||
|
|
||||||
wxRect r(rect);
|
wxRect r(rect);
|
||||||
|
|
||||||
DrawShadedRect(dc, &r, m_penLightGrey, m_penBlack);
|
DrawShadedRect(dc, &r, m_penLightGrey, m_penBlack);
|
||||||
DrawShadedRect(dc, &r, m_penHighlight, m_penDarkGrey);
|
DrawShadedRect(dc, &r, m_penHighlight, m_penDarkGrey);
|
||||||
DrawShadedRect(dc, &r, m_penLightGrey, m_penLightGrey);
|
DrawShadedRect(dc, &r, m_penLightGrey, m_penLightGrey);
|
||||||
@@ -3260,13 +3322,13 @@ void wxWin32Renderer::DrawFrameBackground(wxDC& dc,
|
|||||||
{
|
{
|
||||||
if ( !(flags & wxTOPLEVEL_TITLEBAR) ) return;
|
if ( !(flags & wxTOPLEVEL_TITLEBAR) ) return;
|
||||||
|
|
||||||
wxColour col = (flags & wxTOPLEVEL_ACTIVE) ?
|
wxColour col = (flags & wxTOPLEVEL_ACTIVE) ?
|
||||||
wxSCHEME_COLOUR(m_scheme, TITLEBAR_ACTIVE) :
|
wxSCHEME_COLOUR(m_scheme, TITLEBAR_ACTIVE) :
|
||||||
wxSCHEME_COLOUR(m_scheme, TITLEBAR);
|
wxSCHEME_COLOUR(m_scheme, TITLEBAR);
|
||||||
|
|
||||||
wxRect r = GetFrameClientArea(rect, flags & ~wxTOPLEVEL_TITLEBAR);
|
wxRect r = GetFrameClientArea(rect, flags & ~wxTOPLEVEL_TITLEBAR);
|
||||||
r.height = FRAME_TITLEBAR_HEIGHT;
|
r.height = FRAME_TITLEBAR_HEIGHT;
|
||||||
|
|
||||||
DrawBackground(dc, col, r);
|
DrawBackground(dc, col, r);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3281,7 +3343,7 @@ void wxWin32Renderer::DrawFrameTitle(wxDC& dc,
|
|||||||
r.x += FRAME_TITLEBAR_HEIGHT;
|
r.x += FRAME_TITLEBAR_HEIGHT;
|
||||||
else
|
else
|
||||||
r.x += 1;
|
r.x += 1;
|
||||||
|
|
||||||
dc.SetFont(m_titlebarFont);
|
dc.SetFont(m_titlebarFont);
|
||||||
dc.SetTextForeground(wxSCHEME_COLOUR(m_scheme, TITLEBAR_TEXT));
|
dc.SetTextForeground(wxSCHEME_COLOUR(m_scheme, TITLEBAR_TEXT));
|
||||||
dc.DrawLabel(title, wxNullBitmap, r, wxALIGN_LEFT | wxALIGN_CENTRE_VERTICAL);
|
dc.DrawLabel(title, wxNullBitmap, r, wxALIGN_LEFT | wxALIGN_CENTRE_VERTICAL);
|
||||||
@@ -3317,8 +3379,8 @@ void wxWin32Renderer::DrawFrameButton(wxDC& dc,
|
|||||||
default:
|
default:
|
||||||
wxFAIL_MSG(wxT("incorrect button specification"));
|
wxFAIL_MSG(wxT("incorrect button specification"));
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( flags & wxCONTROL_PRESSED )
|
if ( flags & wxCONTROL_PRESSED )
|
||||||
{
|
{
|
||||||
DrawShadedRect(dc, &r, m_penBlack, m_penHighlight);
|
DrawShadedRect(dc, &r, m_penBlack, m_penHighlight);
|
||||||
DrawShadedRect(dc, &r, m_penDarkGrey, m_penLightGrey);
|
DrawShadedRect(dc, &r, m_penDarkGrey, m_penLightGrey);
|
||||||
@@ -3342,7 +3404,7 @@ wxRect wxWin32Renderer::GetFrameClientArea(const wxRect& rect,
|
|||||||
|
|
||||||
if ( (flags & wxTOPLEVEL_BORDER) && !(flags & wxTOPLEVEL_MAXIMIZED) )
|
if ( (flags & wxTOPLEVEL_BORDER) && !(flags & wxTOPLEVEL_MAXIMIZED) )
|
||||||
{
|
{
|
||||||
int border = (flags & wxTOPLEVEL_RESIZEABLE) ?
|
int border = (flags & wxTOPLEVEL_RESIZEABLE) ?
|
||||||
RESIZEABLE_FRAME_BORDER_THICKNESS :
|
RESIZEABLE_FRAME_BORDER_THICKNESS :
|
||||||
FRAME_BORDER_THICKNESS;
|
FRAME_BORDER_THICKNESS;
|
||||||
r.Inflate(-border);
|
r.Inflate(-border);
|
||||||
@@ -3363,7 +3425,7 @@ wxSize wxWin32Renderer::GetFrameTotalSize(const wxSize& clientSize,
|
|||||||
|
|
||||||
if ( (flags & wxTOPLEVEL_BORDER) && !(flags & wxTOPLEVEL_MAXIMIZED) )
|
if ( (flags & wxTOPLEVEL_BORDER) && !(flags & wxTOPLEVEL_MAXIMIZED) )
|
||||||
{
|
{
|
||||||
int border = (flags & wxTOPLEVEL_RESIZEABLE) ?
|
int border = (flags & wxTOPLEVEL_RESIZEABLE) ?
|
||||||
RESIZEABLE_FRAME_BORDER_THICKNESS :
|
RESIZEABLE_FRAME_BORDER_THICKNESS :
|
||||||
FRAME_BORDER_THICKNESS;
|
FRAME_BORDER_THICKNESS;
|
||||||
s.x += 2*border;
|
s.x += 2*border;
|
||||||
@@ -3495,11 +3557,15 @@ bool wxWin32InputHandler::HandleMouse(wxInputConsumer *control,
|
|||||||
const wxMouseEvent& event)
|
const wxMouseEvent& event)
|
||||||
{
|
{
|
||||||
// clicking on the control gives it focus
|
// clicking on the control gives it focus
|
||||||
if ( event.ButtonDown() && wxWindow::FindFocus() != control->GetInputWindow() )
|
if ( event.ButtonDown() )
|
||||||
{
|
{
|
||||||
control->GetInputWindow()->SetFocus();
|
wxWindow *win = control->GetInputWindow();
|
||||||
|
if ( wxWindow::FindFocus() != control->GetInputWindow() )
|
||||||
|
{
|
||||||
|
win->SetFocus();
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
@@ -3749,3 +3815,81 @@ bool wxWin32TextCtrlInputHandler::HandleKey(wxInputConsumer *control,
|
|||||||
return wxStdTextCtrlInputHandler::HandleKey(control, event, pressed);
|
return wxStdTextCtrlInputHandler::HandleKey(control, event, pressed);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
// wxWin32StatusBarInputHandler
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
wxWin32StatusBarInputHandler::
|
||||||
|
wxWin32StatusBarInputHandler(wxInputHandler *handler)
|
||||||
|
: wxStdInputHandler(handler)
|
||||||
|
{
|
||||||
|
m_isOnGrip = FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool wxWin32StatusBarInputHandler::IsOnGrip(wxWindow *statbar,
|
||||||
|
const wxPoint& pt) const
|
||||||
|
{
|
||||||
|
if ( statbar->HasFlag(wxST_SIZEGRIP) &&
|
||||||
|
statbar->GetParent()->HasFlag(wxRESIZE_BORDER) )
|
||||||
|
{
|
||||||
|
wxSize sizeSbar = statbar->GetSize();
|
||||||
|
|
||||||
|
return (sizeSbar.x - pt.x) < STATUSBAR_GRIP_SIZE &&
|
||||||
|
(sizeSbar.y - pt.y) < STATUSBAR_GRIP_SIZE;
|
||||||
|
}
|
||||||
|
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool wxWin32StatusBarInputHandler::HandleMouse(wxInputConsumer *consumer,
|
||||||
|
const wxMouseEvent& event)
|
||||||
|
{
|
||||||
|
if ( event.Button(1) )
|
||||||
|
{
|
||||||
|
if ( event.ButtonDown(1) )
|
||||||
|
{
|
||||||
|
wxWindow *statbar = consumer->GetInputWindow();
|
||||||
|
|
||||||
|
if ( IsOnGrip(statbar, event.GetPosition()) )
|
||||||
|
{
|
||||||
|
wxTopLevelWindow *tlw = wxDynamicCast(statbar->GetParent(),
|
||||||
|
wxTopLevelWindow);
|
||||||
|
if ( tlw )
|
||||||
|
{
|
||||||
|
tlw->PerformAction(wxACTION_TOPLEVEL_RESIZE,
|
||||||
|
wxHT_TOPLEVEL_BORDER_SE);
|
||||||
|
|
||||||
|
statbar->SetCursor(m_cursorOld);
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return wxStdInputHandler::HandleMouse(consumer, event);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool wxWin32StatusBarInputHandler::HandleMouseMove(wxInputConsumer *consumer,
|
||||||
|
const wxMouseEvent& event)
|
||||||
|
{
|
||||||
|
wxWindow *statbar = consumer->GetInputWindow();
|
||||||
|
|
||||||
|
bool isOnGrip = IsOnGrip(statbar, event.GetPosition());
|
||||||
|
if ( isOnGrip != m_isOnGrip )
|
||||||
|
{
|
||||||
|
m_isOnGrip = isOnGrip;
|
||||||
|
if ( isOnGrip )
|
||||||
|
{
|
||||||
|
m_cursorOld = statbar->GetCursor();
|
||||||
|
statbar->SetCursor(wxCURSOR_SIZENWSE);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
statbar->SetCursor(m_cursorOld);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return wxStdInputHandler::HandleMouseMove(consumer, event);
|
||||||
|
}
|
||||||
|
|
||||||
|
@@ -365,13 +365,13 @@ bool wxTopLevelWindow::PerformAction(const wxControlAction& action,
|
|||||||
ClickTitleBarButton(numArg);
|
ClickTitleBarButton(numArg);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
else if ( action == wxACTION_TOPLEVEL_MOVE )
|
else if ( action == wxACTION_TOPLEVEL_MOVE )
|
||||||
{
|
{
|
||||||
InteractiveMove(wxINTERACTIVE_MOVE);
|
InteractiveMove(wxINTERACTIVE_MOVE);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
else if ( action == wxACTION_TOPLEVEL_RESIZE )
|
else if ( action == wxACTION_TOPLEVEL_RESIZE )
|
||||||
{
|
{
|
||||||
int flags = wxINTERACTIVE_RESIZE;
|
int flags = wxINTERACTIVE_RESIZE;
|
||||||
@@ -386,7 +386,7 @@ bool wxTopLevelWindow::PerformAction(const wxControlAction& action,
|
|||||||
InteractiveMove(flags);
|
InteractiveMove(flags);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
else
|
else
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
@@ -486,25 +486,25 @@ bool wxStdFrameInputHandler::HandleMouseMove(wxInputConsumer *consumer,
|
|||||||
}
|
}
|
||||||
else if ( consumer->GetInputWindow()->GetWindowStyle() & wxRESIZE_BORDER )
|
else if ( consumer->GetInputWindow()->GetWindowStyle() & wxRESIZE_BORDER )
|
||||||
{
|
{
|
||||||
wxTopLevelWindow *win = wxStaticCast(consumer->GetInputWindow(),
|
wxTopLevelWindow *win = wxStaticCast(consumer->GetInputWindow(),
|
||||||
wxTopLevelWindow);
|
wxTopLevelWindow);
|
||||||
long hit = win->HitTest(event.GetPosition());
|
long hit = win->HitTest(event.GetPosition());
|
||||||
|
|
||||||
if ( hit != m_winHitTest )
|
if ( hit != m_winHitTest )
|
||||||
{
|
{
|
||||||
m_winHitTest = hit;
|
m_winHitTest = hit;
|
||||||
|
|
||||||
if ( m_borderCursorOn )
|
if ( m_borderCursorOn )
|
||||||
{
|
{
|
||||||
m_borderCursorOn = FALSE;
|
m_borderCursorOn = FALSE;
|
||||||
win->SetCursor(m_origCursor);
|
win->SetCursor(m_origCursor);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( hit & wxHT_TOPLEVEL_ANY_BORDER )
|
if ( hit & wxHT_TOPLEVEL_ANY_BORDER )
|
||||||
{
|
{
|
||||||
m_borderCursorOn = TRUE;
|
m_borderCursorOn = TRUE;
|
||||||
wxCursor cur;
|
wxCursor cur;
|
||||||
|
|
||||||
switch (hit)
|
switch (hit)
|
||||||
{
|
{
|
||||||
case wxHT_TOPLEVEL_BORDER_N:
|
case wxHT_TOPLEVEL_BORDER_N:
|
||||||
|
105
src/wxUniv.dsp
105
src/wxUniv.dsp
@@ -49,7 +49,7 @@ BSC32=bscmake.exe
|
|||||||
# ADD BSC32 /nologo
|
# ADD BSC32 /nologo
|
||||||
LIB32=link.exe -lib
|
LIB32=link.exe -lib
|
||||||
# ADD BASE LIB32 /nologo
|
# ADD BASE LIB32 /nologo
|
||||||
# ADD LIB32 /nologo /out:"..\lib\wxuniv.lib"
|
# ADD LIB32 /nologo
|
||||||
|
|
||||||
!ELSEIF "$(CFG)" == "wxUniv - Win32 Debug"
|
!ELSEIF "$(CFG)" == "wxUniv - Win32 Debug"
|
||||||
|
|
||||||
@@ -197,6 +197,11 @@ SOURCE=.\common\event.cpp
|
|||||||
# End Source File
|
# End Source File
|
||||||
# Begin Source File
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=.\common\extended.c
|
||||||
|
# SUBTRACT CPP /YX /Yc /Yu
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
SOURCE=.\common\fddlgcmn.cpp
|
SOURCE=.\common\fddlgcmn.cpp
|
||||||
# End Source File
|
# End Source File
|
||||||
# Begin Source File
|
# Begin Source File
|
||||||
@@ -453,6 +458,10 @@ SOURCE=.\common\socket.cpp
|
|||||||
# End Source File
|
# End Source File
|
||||||
# Begin Source File
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=.\common\statbar.cpp
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
SOURCE=.\common\strconv.cpp
|
SOURCE=.\common\strconv.cpp
|
||||||
# End Source File
|
# End Source File
|
||||||
# Begin Source File
|
# Begin Source File
|
||||||
@@ -501,6 +510,11 @@ SOURCE=.\common\txtstrm.cpp
|
|||||||
# End Source File
|
# End Source File
|
||||||
# Begin Source File
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=.\common\unzip.c
|
||||||
|
# SUBTRACT CPP /YX /Yc /Yu
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
SOURCE=.\common\url.cpp
|
SOURCE=.\common\url.cpp
|
||||||
# End Source File
|
# End Source File
|
||||||
# Begin Source File
|
# Begin Source File
|
||||||
@@ -551,18 +565,6 @@ SOURCE=.\common\zipstrm.cpp
|
|||||||
|
|
||||||
SOURCE=.\common\zstream.cpp
|
SOURCE=.\common\zstream.cpp
|
||||||
# End Source File
|
# End Source File
|
||||||
|
|
||||||
# Begin Source File
|
|
||||||
|
|
||||||
SOURCE=.\common\extended.c
|
|
||||||
# SUBTRACT CPP /YX /Yc /Yu
|
|
||||||
# End Source File
|
|
||||||
# Begin Source File
|
|
||||||
|
|
||||||
SOURCE=.\common\unzip.c
|
|
||||||
# SUBTRACT CPP /YX /Yc /Yu
|
|
||||||
# End Source File
|
|
||||||
|
|
||||||
# End Group
|
# End Group
|
||||||
# Begin Group "Generic Files"
|
# Begin Group "Generic Files"
|
||||||
|
|
||||||
@@ -709,10 +711,6 @@ SOURCE=.\generic\splitter.cpp
|
|||||||
# End Source File
|
# End Source File
|
||||||
# Begin Source File
|
# Begin Source File
|
||||||
|
|
||||||
SOURCE=.\generic\statusbr.cpp
|
|
||||||
# End Source File
|
|
||||||
# Begin Source File
|
|
||||||
|
|
||||||
SOURCE=.\generic\tabg.cpp
|
SOURCE=.\generic\tabg.cpp
|
||||||
# End Source File
|
# End Source File
|
||||||
# Begin Source File
|
# Begin Source File
|
||||||
@@ -743,7 +741,6 @@ SOURCE=.\generic\treelay.cpp
|
|||||||
|
|
||||||
SOURCE=.\generic\wizard.cpp
|
SOURCE=.\generic\wizard.cpp
|
||||||
# End Source File
|
# End Source File
|
||||||
|
|
||||||
# End Group
|
# End Group
|
||||||
# Begin Group "wxHTML Files"
|
# Begin Group "wxHTML Files"
|
||||||
|
|
||||||
@@ -828,18 +825,12 @@ SOURCE=.\html\m_tables.cpp
|
|||||||
|
|
||||||
SOURCE=.\html\winpars.cpp
|
SOURCE=.\html\winpars.cpp
|
||||||
# End Source File
|
# End Source File
|
||||||
|
|
||||||
# End Group
|
# End Group
|
||||||
# Begin Group "MSW Files"
|
# Begin Group "MSW Files"
|
||||||
|
|
||||||
# PROP Default_Filter ""
|
# PROP Default_Filter ""
|
||||||
# Begin Source File
|
# Begin Source File
|
||||||
|
|
||||||
SOURCE=.\msw\dummy.cpp
|
|
||||||
# ADD CPP /Yc"wx/wxprec.h"
|
|
||||||
# End Source File
|
|
||||||
# Begin Source File
|
|
||||||
|
|
||||||
SOURCE=.\msw\app.cpp
|
SOURCE=.\msw\app.cpp
|
||||||
# End Source File
|
# End Source File
|
||||||
# Begin Source File
|
# Begin Source File
|
||||||
@@ -904,6 +895,11 @@ SOURCE=.\msw\dir.cpp
|
|||||||
# End Source File
|
# End Source File
|
||||||
# Begin Source File
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=.\msw\dummy.cpp
|
||||||
|
# ADD CPP /Yc"wx/wxprec.h"
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
SOURCE=.\msw\evtloop.cpp
|
SOURCE=.\msw\evtloop.cpp
|
||||||
# End Source File
|
# End Source File
|
||||||
# Begin Source File
|
# Begin Source File
|
||||||
@@ -928,6 +924,16 @@ SOURCE=.\msw\gdiobj.cpp
|
|||||||
# End Source File
|
# End Source File
|
||||||
# Begin Source File
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=.\msw\gsocket.c
|
||||||
|
# SUBTRACT CPP /YX /Yc /Yu
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=.\msw\gsockmsw.c
|
||||||
|
# SUBTRACT CPP /YX /Yc /Yu
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
SOURCE=.\msw\icon.cpp
|
SOURCE=.\msw\icon.cpp
|
||||||
# End Source File
|
# End Source File
|
||||||
# Begin Source File
|
# Begin Source File
|
||||||
@@ -994,22 +1000,22 @@ SOURCE=.\msw\utilsexc.cpp
|
|||||||
|
|
||||||
SOURCE=.\msw\window.cpp
|
SOURCE=.\msw\window.cpp
|
||||||
# End Source File
|
# End Source File
|
||||||
|
|
||||||
# Begin Source File
|
|
||||||
|
|
||||||
SOURCE=.\msw\gsocket.c
|
|
||||||
# SUBTRACT CPP /YX /Yc /Yu
|
|
||||||
# End Source File
|
|
||||||
# Begin Source File
|
|
||||||
|
|
||||||
SOURCE=.\msw\gsockmsw.c
|
|
||||||
# SUBTRACT CPP /YX /Yc /Yu
|
|
||||||
# End Source File
|
|
||||||
|
|
||||||
# End Group
|
# End Group
|
||||||
# Begin Group "Universal Files"
|
# Begin Group "Universal Files"
|
||||||
|
|
||||||
# PROP Default_Filter ""
|
# PROP Default_Filter ""
|
||||||
|
# Begin Group "Theme Files"
|
||||||
|
|
||||||
|
# PROP Default_Filter ""
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=.\univ\themes\gtk.cpp
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=.\univ\themes\win32.cpp
|
||||||
|
# End Source File
|
||||||
|
# End Group
|
||||||
# Begin Source File
|
# Begin Source File
|
||||||
|
|
||||||
SOURCE=.\univ\bmpbuttn.cpp
|
SOURCE=.\univ\bmpbuttn.cpp
|
||||||
@@ -1120,6 +1126,10 @@ SOURCE=.\univ\stattext.cpp
|
|||||||
# End Source File
|
# End Source File
|
||||||
# Begin Source File
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=.\univ\statusbr.cpp
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
SOURCE=.\univ\textctrl.cpp
|
SOURCE=.\univ\textctrl.cpp
|
||||||
# End Source File
|
# End Source File
|
||||||
# Begin Source File
|
# Begin Source File
|
||||||
@@ -1134,20 +1144,6 @@ SOURCE=.\univ\topluniv.cpp
|
|||||||
|
|
||||||
SOURCE=.\univ\winuniv.cpp
|
SOURCE=.\univ\winuniv.cpp
|
||||||
# End Source File
|
# End Source File
|
||||||
|
|
||||||
# Begin Group "Theme Files"
|
|
||||||
|
|
||||||
# PROP Default_Filter ""
|
|
||||||
# Begin Source File
|
|
||||||
|
|
||||||
SOURCE=.\univ\themes\gtk.cpp
|
|
||||||
# End Source File
|
|
||||||
# Begin Source File
|
|
||||||
|
|
||||||
SOURCE=.\univ\themes\win32.cpp
|
|
||||||
# End Source File
|
|
||||||
|
|
||||||
# End Group
|
|
||||||
# End Group
|
# End Group
|
||||||
# Begin Group "Headers"
|
# Begin Group "Headers"
|
||||||
|
|
||||||
@@ -1158,7 +1154,9 @@ SOURCE=.\univ\themes\win32.cpp
|
|||||||
# Begin Source File
|
# Begin Source File
|
||||||
|
|
||||||
SOURCE=..\include\wx\univ\setup.h
|
SOURCE=..\include\wx\univ\setup.h
|
||||||
|
|
||||||
!IF "$(CFG)" == "wxUniv - Win32 Release"
|
!IF "$(CFG)" == "wxUniv - Win32 Release"
|
||||||
|
|
||||||
# Begin Custom Build - Creating wx/setup.h from $(InputPath)
|
# Begin Custom Build - Creating wx/setup.h from $(InputPath)
|
||||||
InputPath=..\include\wx\univ\setup.h
|
InputPath=..\include\wx\univ\setup.h
|
||||||
|
|
||||||
@@ -1166,7 +1164,9 @@ InputPath=..\include\wx\univ\setup.h
|
|||||||
copy $(InputPath) ..\lib\univ\wx\setup.h
|
copy $(InputPath) ..\lib\univ\wx\setup.h
|
||||||
|
|
||||||
# End Custom Build
|
# End Custom Build
|
||||||
|
|
||||||
!ELSEIF "$(CFG)" == "wxUniv - Win32 Debug"
|
!ELSEIF "$(CFG)" == "wxUniv - Win32 Debug"
|
||||||
|
|
||||||
# Begin Custom Build - Creating wx/setup.h from $(InputPath)
|
# Begin Custom Build - Creating wx/setup.h from $(InputPath)
|
||||||
InputPath=..\include\wx\univ\setup.h
|
InputPath=..\include\wx\univ\setup.h
|
||||||
|
|
||||||
@@ -1174,7 +1174,9 @@ InputPath=..\include\wx\univ\setup.h
|
|||||||
copy $(InputPath) ..\lib\univd\wx\setup.h
|
copy $(InputPath) ..\lib\univd\wx\setup.h
|
||||||
|
|
||||||
# End Custom Build
|
# End Custom Build
|
||||||
|
|
||||||
!ENDIF
|
!ENDIF
|
||||||
|
|
||||||
# End Source File
|
# End Source File
|
||||||
# End Group
|
# End Group
|
||||||
# Begin Group "Common"
|
# Begin Group "Common"
|
||||||
@@ -2064,7 +2066,6 @@ SOURCE=..\include\wx\zipstrm.h
|
|||||||
|
|
||||||
SOURCE=..\include\wx\zstream.h
|
SOURCE=..\include\wx\zstream.h
|
||||||
# End Source File
|
# End Source File
|
||||||
|
|
||||||
# End Group
|
# End Group
|
||||||
# Begin Group "MSW"
|
# Begin Group "MSW"
|
||||||
|
|
||||||
@@ -2221,7 +2222,6 @@ SOURCE=..\include\wx\generic\treectlg.h
|
|||||||
|
|
||||||
SOURCE=..\include\wx\generic\wizard.h
|
SOURCE=..\include\wx\generic\wizard.h
|
||||||
# End Source File
|
# End Source File
|
||||||
|
|
||||||
# End Group
|
# End Group
|
||||||
# Begin Group "HTML"
|
# Begin Group "HTML"
|
||||||
|
|
||||||
@@ -2278,7 +2278,6 @@ SOURCE=..\include\wx\html\m_templ.h
|
|||||||
|
|
||||||
SOURCE=..\include\wx\html\winpars.h
|
SOURCE=..\include\wx\html\winpars.h
|
||||||
# End Source File
|
# End Source File
|
||||||
|
|
||||||
# End Group
|
# End Group
|
||||||
# Begin Group "Universal"
|
# Begin Group "Universal"
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user