1. wxCalendarCtrl
2. several wxDateTime bugs corrected, a couple of missing functions added 3. GetBestSize() corrections for several wxGTK controls 4. wxStaticLine doesn't get focus any more under MSW 5. added DoMoveWindow() to wxMotif git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@5142 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
10
Makefile.in
10
Makefile.in
@@ -1,5 +1,5 @@
|
|||||||
#
|
#
|
||||||
# This file was automatically generated by tmake at 16:50, 1999/12/21
|
# This file was automatically generated by tmake at 20:12, 1999/12/29
|
||||||
# DO NOT CHANGE THIS FILE, YOUR CHANGES WILL BE LOST! CHANGE UNX.T!
|
# DO NOT CHANGE THIS FILE, YOUR CHANGES WILL BE LOST! CHANGE UNX.T!
|
||||||
|
|
||||||
#
|
#
|
||||||
@@ -179,6 +179,7 @@ WX_HEADERS = \
|
|||||||
buffer.h \
|
buffer.h \
|
||||||
busyinfo.h \
|
busyinfo.h \
|
||||||
button.h \
|
button.h \
|
||||||
|
calctrl.h \
|
||||||
caret.h \
|
caret.h \
|
||||||
checkbox.h \
|
checkbox.h \
|
||||||
checklst.h \
|
checklst.h \
|
||||||
@@ -581,6 +582,7 @@ UNIX_HEADERS = \
|
|||||||
unix/fontutil.h
|
unix/fontutil.h
|
||||||
|
|
||||||
GENERIC_HEADERS = \
|
GENERIC_HEADERS = \
|
||||||
|
generic/calctrl.h \
|
||||||
generic/caret.h \
|
generic/caret.h \
|
||||||
generic/choicdgg.h \
|
generic/choicdgg.h \
|
||||||
generic/colrdlgg.h \
|
generic/colrdlgg.h \
|
||||||
@@ -635,6 +637,7 @@ HTML_HEADERS = \
|
|||||||
|
|
||||||
GTK_GENERICOBJS = \
|
GTK_GENERICOBJS = \
|
||||||
busyinfo.o \
|
busyinfo.o \
|
||||||
|
calctrl.o \
|
||||||
caret.o \
|
caret.o \
|
||||||
choicdgg.o \
|
choicdgg.o \
|
||||||
colrdlgg.o \
|
colrdlgg.o \
|
||||||
@@ -671,6 +674,7 @@ GTK_GENERICOBJS = \
|
|||||||
|
|
||||||
GTK_GENERICDEPS = \
|
GTK_GENERICDEPS = \
|
||||||
busyinfo.d \
|
busyinfo.d \
|
||||||
|
calctrl.d \
|
||||||
caret.d \
|
caret.d \
|
||||||
choicdgg.d \
|
choicdgg.d \
|
||||||
colrdlgg.d \
|
colrdlgg.d \
|
||||||
@@ -1019,6 +1023,7 @@ GTK_GUIDEPS = \
|
|||||||
|
|
||||||
MOTIF_GENERICOBJS = \
|
MOTIF_GENERICOBJS = \
|
||||||
busyinfo.o \
|
busyinfo.o \
|
||||||
|
calctrl.o \
|
||||||
caret.o \
|
caret.o \
|
||||||
choicdgg.o \
|
choicdgg.o \
|
||||||
colrdlgg.o \
|
colrdlgg.o \
|
||||||
@@ -1058,6 +1063,7 @@ MOTIF_GENERICOBJS = \
|
|||||||
|
|
||||||
MOTIF_GENERICDEPS = \
|
MOTIF_GENERICDEPS = \
|
||||||
busyinfo.d \
|
busyinfo.d \
|
||||||
|
calctrl.d \
|
||||||
caret.d \
|
caret.d \
|
||||||
choicdgg.d \
|
choicdgg.d \
|
||||||
colrdlgg.d \
|
colrdlgg.d \
|
||||||
@@ -1399,6 +1405,7 @@ MOTIF_GUIDEPS = \
|
|||||||
|
|
||||||
MSW_GENERICOBJS = \
|
MSW_GENERICOBJS = \
|
||||||
busyinfo.o \
|
busyinfo.o \
|
||||||
|
calctrl.o \
|
||||||
choicdgg.o \
|
choicdgg.o \
|
||||||
dirdlgg.o \
|
dirdlgg.o \
|
||||||
grid.o \
|
grid.o \
|
||||||
@@ -1421,6 +1428,7 @@ MSW_GENERICOBJS = \
|
|||||||
|
|
||||||
MSW_GENERICDEPS = \
|
MSW_GENERICDEPS = \
|
||||||
busyinfo.d \
|
busyinfo.d \
|
||||||
|
calctrl.d \
|
||||||
choicdgg.d \
|
choicdgg.d \
|
||||||
dirdlgg.d \
|
dirdlgg.d \
|
||||||
grid.d \
|
grid.d \
|
||||||
|
@@ -57,6 +57,7 @@
|
|||||||
# File name Type Flags
|
# File name Type Flags
|
||||||
|
|
||||||
busyinfo.cpp G
|
busyinfo.cpp G
|
||||||
|
calctrl.cpp G
|
||||||
caret.cpp G U
|
caret.cpp G U
|
||||||
choicdgg.cpp G
|
choicdgg.cpp G
|
||||||
colrdlgg.cpp G G
|
colrdlgg.cpp G G
|
||||||
@@ -518,6 +519,7 @@ brush.h W
|
|||||||
buffer.h W
|
buffer.h W
|
||||||
busyinfo.h W
|
busyinfo.h W
|
||||||
button.h W
|
button.h W
|
||||||
|
calctrl.h W
|
||||||
caret.h W
|
caret.h W
|
||||||
checkbox.h W
|
checkbox.h W
|
||||||
checklst.h W
|
checklst.h W
|
||||||
@@ -1033,6 +1035,7 @@ winpars.h L
|
|||||||
m_templ.h L
|
m_templ.h L
|
||||||
htmprint.h L
|
htmprint.h L
|
||||||
|
|
||||||
|
calctrl.h N
|
||||||
caret.h N
|
caret.h N
|
||||||
choicdgg.h N
|
choicdgg.h N
|
||||||
colrdlgg.h N
|
colrdlgg.h N
|
||||||
|
@@ -6,6 +6,8 @@ Classes: \helpref{wxDataObject}{wxdataobject},
|
|||||||
\helpref{wxDropSource}{wxdropsource},
|
\helpref{wxDropSource}{wxdropsource},
|
||||||
\helpref{wxDropTarget}{wxdroptarget}
|
\helpref{wxDropTarget}{wxdroptarget}
|
||||||
|
|
||||||
|
See also: \helpref{Drag and drop overview}{wxdndoverview} and \helpref{DnD sample}{samplednd}
|
||||||
|
|
||||||
This overview discusses data transfer through clipboard or drag and drop. In
|
This overview discusses data transfer through clipboard or drag and drop. In
|
||||||
wxWindows, these two ways to transfer data (either between different
|
wxWindows, these two ways to transfer data (either between different
|
||||||
applications or inside one and the same) are very similar which allows to
|
applications or inside one and the same) are very similar which allows to
|
||||||
|
39
include/wx/calctrl.h
Normal file
39
include/wx/calctrl.h
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Name: wx/calctrl.h
|
||||||
|
// Purpose: date-picker control
|
||||||
|
// Author: Vadim Zeitlin
|
||||||
|
// Modified by:
|
||||||
|
// Created: 29.12.99
|
||||||
|
// RCS-ID: $Id$
|
||||||
|
// Copyright: (c) 1999 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr>
|
||||||
|
// Licence: wxWindows license
|
||||||
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#ifndef _WX_CALCTRL_H
|
||||||
|
#define _WX_CALCTRL_H
|
||||||
|
|
||||||
|
// so far we only have a generic version, so keep it simple
|
||||||
|
#include "wx/generic/calctrl.h"
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
// wxCalendarCtrl events
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
class WXDLLEXPORT wxCalendarEvent : public wxCommandEvent
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
wxCalendarEvent() { }
|
||||||
|
wxCalendarEvent(wxCalendarCtrl *cal, wxEventType type);
|
||||||
|
|
||||||
|
const wxDateTime& GetDate() const { return m_date; }
|
||||||
|
|
||||||
|
private:
|
||||||
|
wxDateTime m_date;
|
||||||
|
};
|
||||||
|
|
||||||
|
#define EVT_CALENDAR(id, fn) { wxEVT_CALENDAR_SEL_CHANGED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) & fn, (wxObject *) NULL },
|
||||||
|
#define EVT_CALENDAR_DAY(id, fn) { wxEVT_CALENDAR_DAY_CHANGED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) & fn, (wxObject *) NULL },
|
||||||
|
#define EVT_CALENDAR_MONTH(id, fn) { wxEVT_CALENDAR_MONTH_CHANGED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) & fn, (wxObject *) NULL },
|
||||||
|
#define EVT_CALENDAR_YEAR(id, fn) { wxEVT_CALENDAR_YEAR_CHANGED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) & fn, (wxObject *) NULL },
|
||||||
|
|
||||||
|
#endif // _WX_CALCTRL_H
|
@@ -363,6 +363,14 @@ public:
|
|||||||
Name_Abbr = 0x02 // return abbreviated name
|
Name_Abbr = 0x02 // return abbreviated name
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// flags for GetWeekOfYear and GetWeekOfMonth
|
||||||
|
enum WeekFlags
|
||||||
|
{
|
||||||
|
Default_First, // Sunday_First for US, Monday_First for the rest
|
||||||
|
Monday_First, // week starts with a Monday
|
||||||
|
Sunday_First // week starts with a Sunday
|
||||||
|
};
|
||||||
|
|
||||||
// helper classes
|
// helper classes
|
||||||
// ------------------------------------------------------------------------
|
// ------------------------------------------------------------------------
|
||||||
|
|
||||||
@@ -767,10 +775,12 @@ public:
|
|||||||
wxDateTime_t GetDayOfYear(const TimeZone& tz = Local) const;
|
wxDateTime_t GetDayOfYear(const TimeZone& tz = Local) const;
|
||||||
// get the week number since the year start (1..52 or 53, 0 if date is
|
// get the week number since the year start (1..52 or 53, 0 if date is
|
||||||
// invalid)
|
// invalid)
|
||||||
wxDateTime_t GetWeekOfYear(const TimeZone& tz = Local) const;
|
wxDateTime_t GetWeekOfYear(WeekFlags flags = Monday_First,
|
||||||
|
const TimeZone& tz = Local) const;
|
||||||
// get the week number since the month start (1..5, 0 if date is
|
// get the week number since the month start (1..5, 0 if date is
|
||||||
// invalid)
|
// invalid)
|
||||||
wxDateTime_t GetWeekOfMonth(const TimeZone& tz = Local) const;
|
wxDateTime_t GetWeekOfMonth(WeekFlags flags = Monday_First,
|
||||||
|
const TimeZone& tz = Local) const;
|
||||||
|
|
||||||
// is this date a work day? This depends on a country, of course,
|
// is this date a work day? This depends on a country, of course,
|
||||||
// because the holidays are different in different countries
|
// because the holidays are different in different countries
|
||||||
@@ -881,6 +891,9 @@ public:
|
|||||||
wxString FormatDate() const { return Format(_T("%x")); }
|
wxString FormatDate() const { return Format(_T("%x")); }
|
||||||
// preferred time representation for the current locale
|
// preferred time representation for the current locale
|
||||||
wxString FormatTime() const { return Format(_T("%X")); }
|
wxString FormatTime() const { return Format(_T("%X")); }
|
||||||
|
// return the string representing the date in ISO 8601 format
|
||||||
|
// (YYYY-MM-DD)
|
||||||
|
wxString FormatISODate() const { return Format(_T("%Y-%m-%d")); }
|
||||||
|
|
||||||
// implementation
|
// implementation
|
||||||
// ------------------------------------------------------------------------
|
// ------------------------------------------------------------------------
|
||||||
|
@@ -35,13 +35,18 @@ bool wxDateTime::IsInStdRange() const
|
|||||||
/* static */
|
/* static */
|
||||||
wxDateTime wxDateTime::Now()
|
wxDateTime wxDateTime::Now()
|
||||||
{
|
{
|
||||||
return wxDateTime(GetTimeNow());
|
return wxDateTime(*GetTmNow());
|
||||||
}
|
}
|
||||||
|
|
||||||
/* static */
|
/* static */
|
||||||
wxDateTime wxDateTime::Today()
|
wxDateTime wxDateTime::Today()
|
||||||
{
|
{
|
||||||
return wxDateTime((time_t)(86400*(GetTimeNow() / 86400)));
|
struct tm *tm = GetTmNow();
|
||||||
|
tm->tm_hour =
|
||||||
|
tm->tm_min =
|
||||||
|
tm->tm_sec = 0;
|
||||||
|
|
||||||
|
return wxDateTime(*tm);
|
||||||
}
|
}
|
||||||
|
|
||||||
wxDateTime& wxDateTime::Set(time_t timet)
|
wxDateTime& wxDateTime::Set(time_t timet)
|
||||||
@@ -55,7 +60,7 @@ wxDateTime& wxDateTime::Set(time_t timet)
|
|||||||
|
|
||||||
wxDateTime& wxDateTime::SetToCurrent()
|
wxDateTime& wxDateTime::SetToCurrent()
|
||||||
{
|
{
|
||||||
return Set(GetTimeNow());
|
return *this = Now();
|
||||||
}
|
}
|
||||||
|
|
||||||
wxDateTime::wxDateTime(time_t timet)
|
wxDateTime::wxDateTime(time_t timet)
|
||||||
|
@@ -250,6 +250,12 @@ const wxEventType wxEVT_WIZARD_PAGE_CHANGED = wxEVT_FIRST + 900;
|
|||||||
const wxEventType wxEVT_WIZARD_PAGE_CHANGING = wxEVT_FIRST + 901;
|
const wxEventType wxEVT_WIZARD_PAGE_CHANGING = wxEVT_FIRST + 901;
|
||||||
const wxEventType wxEVT_WIZARD_CANCEL = wxEVT_FIRST + 902;
|
const wxEventType wxEVT_WIZARD_CANCEL = wxEVT_FIRST + 902;
|
||||||
|
|
||||||
|
/* Calendar events */
|
||||||
|
const wxEventType wxEVT_CALENDAR_SEL_CHANGED = wxEVT_FIRST + 950;
|
||||||
|
const wxEventType wxEVT_CALENDAR_DAY_CHANGED = wxEVT_FIRST + 951;
|
||||||
|
const wxEventType wxEVT_CALENDAR_MONTH_CHANGED = wxEVT_FIRST + 952;
|
||||||
|
const wxEventType wxEVT_CALENDAR_YEAR_CHANGED = wxEVT_FIRST + 953;
|
||||||
|
|
||||||
const wxEventType wxEVT_USER_FIRST = wxEVT_FIRST + 2000;
|
const wxEventType wxEVT_USER_FIRST = wxEVT_FIRST + 2000;
|
||||||
|
|
||||||
/* Compatibility */
|
/* Compatibility */
|
||||||
|
@@ -63,12 +63,6 @@ public:
|
|||||||
// value
|
// value
|
||||||
bool HitTest(const wxPoint& pos, wxDateTime *date);
|
bool HitTest(const wxPoint& pos, wxDateTime *date);
|
||||||
|
|
||||||
// implementation only from now on
|
|
||||||
// -------------------------------
|
|
||||||
|
|
||||||
void OnPaint(wxPaintEvent& event);
|
|
||||||
void OnClick(wxMouseEvent& event);
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// common part of all ctors
|
// common part of all ctors
|
||||||
void Init();
|
void Init();
|
||||||
@@ -78,12 +72,37 @@ private:
|
|||||||
virtual void DoSetSize(int x, int y, int width, int height, int sizeFlags);
|
virtual void DoSetSize(int x, int y, int width, int height, int sizeFlags);
|
||||||
virtual void DoMoveWindow(int x, int y, int width, int height);
|
virtual void DoMoveWindow(int x, int y, int width, int height);
|
||||||
|
|
||||||
|
// (re)calc m_widthCol and m_heightRow
|
||||||
|
void RecalcGeometry();
|
||||||
|
|
||||||
|
// event handlers
|
||||||
|
void OnPaint(wxPaintEvent& event);
|
||||||
|
void OnClick(wxMouseEvent& event);
|
||||||
|
void OnChar(wxKeyEvent& event);
|
||||||
|
void OnMonthChange(wxCommandEvent& event);
|
||||||
|
void OnYearChange(wxSpinEvent& event);
|
||||||
|
|
||||||
|
// set the date and send the notification
|
||||||
|
void SetDateAndNotify(const wxDateTime& date);
|
||||||
|
|
||||||
|
// get the week (row, in range 1..6) for the given date
|
||||||
|
size_t GetWeek(const wxDateTime& date) const;
|
||||||
|
|
||||||
// get the date from which we start drawing days
|
// get the date from which we start drawing days
|
||||||
wxDateTime GetStartDate() const;
|
wxDateTime GetStartDate() const;
|
||||||
|
|
||||||
// is this date shown?
|
// is this date shown?
|
||||||
bool IsDateShown(const wxDateTime& date) const;
|
bool IsDateShown(const wxDateTime& date) const;
|
||||||
|
|
||||||
|
// redraw the given date
|
||||||
|
void RefreshDate(const wxDateTime& date);
|
||||||
|
|
||||||
|
// change the date inside the same month/year
|
||||||
|
void ChangeDay(const wxDateTime& date);
|
||||||
|
|
||||||
|
// generate a calendar event
|
||||||
|
void GenerateEvent(wxEventType type);
|
||||||
|
|
||||||
// the subcontrols
|
// the subcontrols
|
||||||
wxComboBox *m_comboMonth;
|
wxComboBox *m_comboMonth;
|
||||||
wxSpinCtrl *m_spinYear;
|
wxSpinCtrl *m_spinYear;
|
||||||
@@ -94,6 +113,9 @@ private:
|
|||||||
wxCoord m_widthCol,
|
wxCoord m_widthCol,
|
||||||
m_heightRow;
|
m_heightRow;
|
||||||
|
|
||||||
|
// the week day names
|
||||||
|
wxString m_weekdays[7];
|
||||||
|
|
||||||
DECLARE_DYNAMIC_CLASS(wxCalendarCtrl)
|
DECLARE_DYNAMIC_CLASS(wxCalendarCtrl)
|
||||||
DECLARE_EVENT_TABLE()
|
DECLARE_EVENT_TABLE()
|
||||||
};
|
};
|
||||||
|
@@ -55,6 +55,9 @@ public:
|
|||||||
GtkAdjustment *m_adjust;
|
GtkAdjustment *m_adjust;
|
||||||
float m_oldPos;
|
float m_oldPos;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
virtual wxSize DoGetBestSize() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
DECLARE_EVENT_TABLE()
|
DECLARE_EVENT_TABLE()
|
||||||
DECLARE_DYNAMIC_CLASS(wxSpinButton)
|
DECLARE_DYNAMIC_CLASS(wxSpinButton)
|
||||||
|
@@ -69,6 +69,9 @@ public:
|
|||||||
GtkAdjustment *m_adjust;
|
GtkAdjustment *m_adjust;
|
||||||
float m_oldPos;
|
float m_oldPos;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
virtual wxSize DoGetBestSize() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
DECLARE_DYNAMIC_CLASS(wxSpinCtrl)
|
DECLARE_DYNAMIC_CLASS(wxSpinCtrl)
|
||||||
DECLARE_EVENT_TABLE()
|
DECLARE_EVENT_TABLE()
|
||||||
|
@@ -104,10 +104,6 @@ public:
|
|||||||
// implementation
|
// implementation
|
||||||
// --------------
|
// --------------
|
||||||
|
|
||||||
// move the window to the specified location and resize it: this is called
|
|
||||||
// from both DoSetSize() and DoSetClientSize()
|
|
||||||
virtual void DoMoveWindow(int x, int y, int width, int height);
|
|
||||||
|
|
||||||
virtual WXWidget GetHandle() const { return m_widget; }
|
virtual WXWidget GetHandle() const { return m_widget; }
|
||||||
|
|
||||||
// also sets the global flag
|
// also sets the global flag
|
||||||
@@ -224,6 +220,7 @@ public:
|
|||||||
int width, int height,
|
int width, int height,
|
||||||
int sizeFlags = wxSIZE_AUTO);
|
int sizeFlags = wxSIZE_AUTO);
|
||||||
virtual void DoSetClientSize(int width, int height);
|
virtual void DoSetClientSize(int width, int height);
|
||||||
|
virtual void DoMoveWindow(int x, int y, int width, int height);
|
||||||
|
|
||||||
#if wxUSE_TOOLTIPS
|
#if wxUSE_TOOLTIPS
|
||||||
virtual void DoSetToolTip( wxToolTip *tip );
|
virtual void DoSetToolTip( wxToolTip *tip );
|
||||||
|
@@ -55,6 +55,9 @@ public:
|
|||||||
GtkAdjustment *m_adjust;
|
GtkAdjustment *m_adjust;
|
||||||
float m_oldPos;
|
float m_oldPos;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
virtual wxSize DoGetBestSize() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
DECLARE_EVENT_TABLE()
|
DECLARE_EVENT_TABLE()
|
||||||
DECLARE_DYNAMIC_CLASS(wxSpinButton)
|
DECLARE_DYNAMIC_CLASS(wxSpinButton)
|
||||||
|
@@ -69,6 +69,9 @@ public:
|
|||||||
GtkAdjustment *m_adjust;
|
GtkAdjustment *m_adjust;
|
||||||
float m_oldPos;
|
float m_oldPos;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
virtual wxSize DoGetBestSize() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
DECLARE_DYNAMIC_CLASS(wxSpinCtrl)
|
DECLARE_DYNAMIC_CLASS(wxSpinCtrl)
|
||||||
DECLARE_EVENT_TABLE()
|
DECLARE_EVENT_TABLE()
|
||||||
|
@@ -104,10 +104,6 @@ public:
|
|||||||
// implementation
|
// implementation
|
||||||
// --------------
|
// --------------
|
||||||
|
|
||||||
// move the window to the specified location and resize it: this is called
|
|
||||||
// from both DoSetSize() and DoSetClientSize()
|
|
||||||
virtual void DoMoveWindow(int x, int y, int width, int height);
|
|
||||||
|
|
||||||
virtual WXWidget GetHandle() const { return m_widget; }
|
virtual WXWidget GetHandle() const { return m_widget; }
|
||||||
|
|
||||||
// also sets the global flag
|
// also sets the global flag
|
||||||
@@ -224,6 +220,7 @@ public:
|
|||||||
int width, int height,
|
int width, int height,
|
||||||
int sizeFlags = wxSIZE_AUTO);
|
int sizeFlags = wxSIZE_AUTO);
|
||||||
virtual void DoSetClientSize(int width, int height);
|
virtual void DoSetClientSize(int width, int height);
|
||||||
|
virtual void DoMoveWindow(int x, int y, int width, int height);
|
||||||
|
|
||||||
#if wxUSE_TOOLTIPS
|
#if wxUSE_TOOLTIPS
|
||||||
virtual void DoSetToolTip( wxToolTip *tip );
|
virtual void DoSetToolTip( wxToolTip *tip );
|
||||||
|
@@ -313,6 +313,7 @@ protected:
|
|||||||
int width, int height,
|
int width, int height,
|
||||||
int sizeFlags = wxSIZE_AUTO);
|
int sizeFlags = wxSIZE_AUTO);
|
||||||
virtual void DoSetClientSize(int width, int height);
|
virtual void DoSetClientSize(int width, int height);
|
||||||
|
virtual void DoMoveWindow(int x, int y, int width, int height);
|
||||||
virtual bool DoPopupMenu(wxMenu *menu, int x, int y);
|
virtual bool DoPopupMenu(wxMenu *menu, int x, int y);
|
||||||
|
|
||||||
#if wxUSE_TOOLTIPS
|
#if wxUSE_TOOLTIPS
|
||||||
|
@@ -43,6 +43,9 @@ public:
|
|||||||
const wxSize &size = wxDefaultSize,
|
const wxSize &size = wxDefaultSize,
|
||||||
long style = wxLI_HORIZONTAL,
|
long style = wxLI_HORIZONTAL,
|
||||||
const wxString &name = wxStaticTextNameStr );
|
const wxString &name = wxStaticTextNameStr );
|
||||||
|
|
||||||
|
// overriden base class virtuals
|
||||||
|
virtual bool AcceptsFocus() const { return FALSE; }
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // _WX_MSW_STATLINE_H_
|
#endif // _WX_MSW_STATLINE_H_
|
||||||
|
@@ -12,8 +12,7 @@
|
|||||||
#ifndef _WX_SPINCTRL_H_
|
#ifndef _WX_SPINCTRL_H_
|
||||||
#define _WX_SPINCTRL_H_
|
#define _WX_SPINCTRL_H_
|
||||||
|
|
||||||
#include "wx/control.h"
|
#include "wx/spinbutt.h" // should make wxSpinEvent visible to the app
|
||||||
#include "wx/event.h"
|
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
// a spin ctrl is a text control with a spin button which is usually used to
|
// a spin ctrl is a text control with a spin button which is usually used to
|
||||||
|
@@ -813,6 +813,12 @@ protected:
|
|||||||
// same as DoSetSize() for the client size
|
// same as DoSetSize() for the client size
|
||||||
virtual void DoSetClientSize(int width, int height) = 0;
|
virtual void DoSetClientSize(int width, int height) = 0;
|
||||||
|
|
||||||
|
// move the window to the specified location and resize it: this is called
|
||||||
|
// from both DoSetSize() and DoSetClientSize() and would usually just
|
||||||
|
// reposition this window except for composite controls which will want to
|
||||||
|
// arrange themselves inside the given rectangle
|
||||||
|
virtual void DoMoveWindow(int x, int y, int width, int height) = 0;
|
||||||
|
|
||||||
#if wxUSE_TOOLTIPS
|
#if wxUSE_TOOLTIPS
|
||||||
virtual void DoSetToolTip( wxToolTip *tip );
|
virtual void DoSetToolTip( wxToolTip *tip );
|
||||||
#endif // wxUSE_TOOLTIPS
|
#endif // wxUSE_TOOLTIPS
|
||||||
|
@@ -426,6 +426,13 @@ static void TestTimeZones()
|
|||||||
printf("Current time in Paris:\t%s\n", now.Format("%c", wxDateTime::CET).c_str());
|
printf("Current time in Paris:\t%s\n", now.Format("%c", wxDateTime::CET).c_str());
|
||||||
printf(" Moscow:\t%s\n", now.Format("%c", wxDateTime::MSK).c_str());
|
printf(" Moscow:\t%s\n", now.Format("%c", wxDateTime::MSK).c_str());
|
||||||
printf(" New York:\t%s\n", now.Format("%c", wxDateTime::EST).c_str());
|
printf(" New York:\t%s\n", now.Format("%c", wxDateTime::EST).c_str());
|
||||||
|
|
||||||
|
wxDateTime::Tm tm = now.GetTm();
|
||||||
|
if ( wxDateTime(tm) != now )
|
||||||
|
{
|
||||||
|
printf("ERROR: got %s instead of %s\n",
|
||||||
|
wxDateTime(tm).Format().c_str(), now.Format().c_str());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// test some minimal support for the dates outside the standard range
|
// test some minimal support for the dates outside the standard range
|
||||||
@@ -666,7 +673,9 @@ static void TestTimeWNumber()
|
|||||||
struct WeekNumberTestData
|
struct WeekNumberTestData
|
||||||
{
|
{
|
||||||
Date date; // the date
|
Date date; // the date
|
||||||
wxDateTime::wxDateTime_t week; // the week number
|
wxDateTime::wxDateTime_t week; // the week number in the year
|
||||||
|
wxDateTime::wxDateTime_t wmon; // the week number in the month
|
||||||
|
wxDateTime::wxDateTime_t wmon2; // same but week starts with Sun
|
||||||
wxDateTime::wxDateTime_t dnum; // day number in the year
|
wxDateTime::wxDateTime_t dnum; // day number in the year
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -679,6 +688,18 @@ from string import *
|
|||||||
monthNames = [ 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec' ]
|
monthNames = [ 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec' ]
|
||||||
wdayNames = [ 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun' ]
|
wdayNames = [ 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun' ]
|
||||||
|
|
||||||
|
def GetMonthWeek(dt):
|
||||||
|
weekNumMonth = dt.iso_week[1] - DateTime(dt.year, dt.month, 1).iso_week[1] + 1
|
||||||
|
if weekNumMonth < 0:
|
||||||
|
weekNumMonth = weekNumMonth + 53
|
||||||
|
return weekNumMonth
|
||||||
|
|
||||||
|
def GetLastSundayBefore(dt):
|
||||||
|
if dt.iso_week[2] == 7:
|
||||||
|
return dt
|
||||||
|
else:
|
||||||
|
return dt - DateTimeDelta(dt.iso_week[2])
|
||||||
|
|
||||||
for n in range(20):
|
for n in range(20):
|
||||||
year = randint(1900, 2100)
|
year = randint(1900, 2100)
|
||||||
month = randint(1, 12)
|
month = randint(1, 12)
|
||||||
@@ -686,34 +707,54 @@ for n in range(20):
|
|||||||
dt = DateTime(year, month, day)
|
dt = DateTime(year, month, day)
|
||||||
dayNum = dt.day_of_year
|
dayNum = dt.day_of_year
|
||||||
weekNum = dt.iso_week[1]
|
weekNum = dt.iso_week[1]
|
||||||
|
weekNumMonth = GetMonthWeek(dt)
|
||||||
|
|
||||||
data = { 'day': rjust(`day`, 2), 'month': monthNames[month - 1], 'year': year, 'weekNum': rjust(`weekNum`, 2), 'dayNum': rjust(`dayNum`, 3) }
|
weekNumMonth2 = 0
|
||||||
|
dtSunday = GetLastSundayBefore(dt)
|
||||||
|
|
||||||
print "{ { %(day)s, wxDateTime::%(month)s, %(year)d }, %(weekNum)s, "\
|
while dtSunday >= GetLastSundayBefore(DateTime(dt.year, dt.month, 1)):
|
||||||
|
weekNumMonth2 = weekNumMonth2 + 1
|
||||||
|
dtSunday = dtSunday - DateTimeDelta(7)
|
||||||
|
|
||||||
|
data = { 'day': rjust(`day`, 2), \
|
||||||
|
'month': monthNames[month - 1], \
|
||||||
|
'year': year, \
|
||||||
|
'weekNum': rjust(`weekNum`, 2), \
|
||||||
|
'weekNumMonth': weekNumMonth, \
|
||||||
|
'weekNumMonth2': weekNumMonth2, \
|
||||||
|
'dayNum': rjust(`dayNum`, 3) }
|
||||||
|
|
||||||
|
print " { { %(day)s, "\
|
||||||
|
"wxDateTime::%(month)s, "\
|
||||||
|
"%(year)d }, "\
|
||||||
|
"%(weekNum)s, "\
|
||||||
|
"%(weekNumMonth)s, "\
|
||||||
|
"%(weekNumMonth2)s, "\
|
||||||
"%(dayNum)s }," % data
|
"%(dayNum)s }," % data
|
||||||
|
|
||||||
*/
|
*/
|
||||||
static const WeekNumberTestData weekNumberTestDates[] =
|
static const WeekNumberTestData weekNumberTestDates[] =
|
||||||
{
|
{
|
||||||
{ { 2, wxDateTime::Jul, 2093 }, 27, 183 },
|
{ { 27, wxDateTime::Dec, 1966 }, 52, 5, 5, 361 },
|
||||||
{ { 25, wxDateTime::Jun, 1986 }, 26, 176 },
|
{ { 22, wxDateTime::Jul, 1926 }, 29, 4, 4, 203 },
|
||||||
{ { 15, wxDateTime::Jun, 2014 }, 24, 166 },
|
{ { 22, wxDateTime::Oct, 2076 }, 43, 4, 4, 296 },
|
||||||
{ { 20, wxDateTime::Jul, 2018 }, 29, 201 },
|
{ { 1, wxDateTime::Jul, 1967 }, 26, 1, 1, 182 },
|
||||||
{ { 3, wxDateTime::Aug, 2074 }, 31, 215 },
|
{ { 8, wxDateTime::Nov, 2004 }, 46, 2, 2, 313 },
|
||||||
{ { 26, wxDateTime::Jul, 2012 }, 30, 208 },
|
{ { 21, wxDateTime::Mar, 1920 }, 12, 3, 4, 81 },
|
||||||
{ { 4, wxDateTime::Nov, 1915 }, 44, 308 },
|
{ { 7, wxDateTime::Jan, 1965 }, 1, 2, 2, 7 },
|
||||||
{ { 11, wxDateTime::Feb, 2035 }, 6, 42 },
|
{ { 19, wxDateTime::Oct, 1999 }, 42, 4, 4, 292 },
|
||||||
{ { 15, wxDateTime::Feb, 1942 }, 7, 46 },
|
{ { 13, wxDateTime::Aug, 1955 }, 32, 2, 2, 225 },
|
||||||
{ { 5, wxDateTime::Jan, 2087 }, 1, 5 },
|
{ { 18, wxDateTime::Jul, 2087 }, 29, 3, 3, 199 },
|
||||||
{ { 6, wxDateTime::Nov, 2016 }, 44, 311 },
|
{ { 2, wxDateTime::Sep, 2028 }, 35, 1, 1, 246 },
|
||||||
{ { 6, wxDateTime::Jun, 2057 }, 23, 157 },
|
{ { 28, wxDateTime::Jul, 1945 }, 30, 5, 4, 209 },
|
||||||
{ { 25, wxDateTime::Feb, 1976 }, 9, 56 },
|
{ { 15, wxDateTime::Jun, 1901 }, 24, 3, 3, 166 },
|
||||||
{ { 12, wxDateTime::Jan, 2073 }, 2, 12 },
|
{ { 10, wxDateTime::Oct, 1939 }, 41, 3, 2, 283 },
|
||||||
{ { 12, wxDateTime::Sep, 2040 }, 37, 256 },
|
{ { 3, wxDateTime::Dec, 1965 }, 48, 1, 1, 337 },
|
||||||
{ { 15, wxDateTime::Jul, 1931 }, 29, 196 },
|
{ { 23, wxDateTime::Feb, 1940 }, 8, 4, 4, 54 },
|
||||||
{ { 23, wxDateTime::Mar, 2084 }, 12, 83 },
|
{ { 2, wxDateTime::Jan, 1987 }, 1, 1, 1, 2 },
|
||||||
{ { 12, wxDateTime::Dec, 1970 }, 50, 346 },
|
{ { 11, wxDateTime::Aug, 2079 }, 32, 2, 2, 223 },
|
||||||
{ { 6, wxDateTime::Sep, 1996 }, 36, 250 },
|
{ { 2, wxDateTime::Feb, 2063 }, 5, 1, 1, 33 },
|
||||||
{ { 7, wxDateTime::Jan, 2076 }, 2, 7 },
|
{ { 16, wxDateTime::Oct, 1942 }, 42, 3, 3, 289 },
|
||||||
};
|
};
|
||||||
|
|
||||||
for ( size_t n = 0; n < WXSIZEOF(weekNumberTestDates); n++ )
|
for ( size_t n = 0; n < WXSIZEOF(weekNumberTestDates); n++ )
|
||||||
@@ -723,8 +764,11 @@ for n in range(20):
|
|||||||
|
|
||||||
wxDateTime dt = d.DT();
|
wxDateTime dt = d.DT();
|
||||||
|
|
||||||
wxDateTime::wxDateTime_t week = dt.GetWeekOfYear(),
|
wxDateTime::wxDateTime_t
|
||||||
dnum = dt.GetDayOfYear();
|
week = dt.GetWeekOfYear(wxDateTime::Monday_First),
|
||||||
|
wmon = dt.GetWeekOfMonth(wxDateTime::Monday_First),
|
||||||
|
wmon2 = dt.GetWeekOfMonth(wxDateTime::Sunday_First),
|
||||||
|
dnum = dt.GetDayOfYear();
|
||||||
|
|
||||||
printf("%s: the day number is %d",
|
printf("%s: the day number is %d",
|
||||||
d.FormatDate().c_str(), dnum);
|
d.FormatDate().c_str(), dnum);
|
||||||
@@ -737,7 +781,27 @@ for n in range(20):
|
|||||||
printf(" (ERROR: should be %d)", wn.dnum);
|
printf(" (ERROR: should be %d)", wn.dnum);
|
||||||
}
|
}
|
||||||
|
|
||||||
printf(", week number is %d", week);
|
printf(", week in month is %d", wmon);
|
||||||
|
if ( wmon == wn.wmon )
|
||||||
|
{
|
||||||
|
printf(" (ok)");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
printf(" (ERROR: should be %d)", wn.wmon);
|
||||||
|
}
|
||||||
|
|
||||||
|
printf(" or %d", wmon2);
|
||||||
|
if ( wmon2 == wn.wmon2 )
|
||||||
|
{
|
||||||
|
printf(" (ok)");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
printf(" (ERROR: should be %d)", wn.wmon2);
|
||||||
|
}
|
||||||
|
|
||||||
|
printf(", week in year is %d", week);
|
||||||
if ( week == wn.week )
|
if ( week == wn.week )
|
||||||
{
|
{
|
||||||
puts(" (ok)");
|
puts(" (ok)");
|
||||||
@@ -991,6 +1055,101 @@ static void TestTimeParse()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void TestInteractive()
|
||||||
|
{
|
||||||
|
puts("\n*** interactive wxDateTime tests ***");
|
||||||
|
|
||||||
|
char buf[128];
|
||||||
|
|
||||||
|
for ( ;; )
|
||||||
|
{
|
||||||
|
printf("Enter a date: ");
|
||||||
|
if ( !fgets(buf, WXSIZEOF(buf), stdin) )
|
||||||
|
break;
|
||||||
|
|
||||||
|
wxDateTime dt;
|
||||||
|
if ( !dt.ParseDate(buf) )
|
||||||
|
{
|
||||||
|
puts("failed to parse the date");
|
||||||
|
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
printf("%s: day %u, week of month %u/%u, week of year %u\n",
|
||||||
|
dt.FormatISODate().c_str(),
|
||||||
|
dt.GetDayOfYear(),
|
||||||
|
dt.GetWeekOfMonth(wxDateTime::Monday_First),
|
||||||
|
dt.GetWeekOfMonth(wxDateTime::Sunday_First),
|
||||||
|
dt.GetWeekOfYear(wxDateTime::Monday_First));
|
||||||
|
}
|
||||||
|
|
||||||
|
puts("\n*** done ***");
|
||||||
|
}
|
||||||
|
|
||||||
|
static void TestTimeArithmetics()
|
||||||
|
{
|
||||||
|
puts("\n*** testing arithmetic operations on wxDateTime ***");
|
||||||
|
|
||||||
|
static const struct
|
||||||
|
{
|
||||||
|
wxDateSpan span;
|
||||||
|
const char *name;
|
||||||
|
} testArithmData[] =
|
||||||
|
{
|
||||||
|
{ wxDateSpan::Day(), "day" },
|
||||||
|
{ wxDateSpan::Week(), "week" },
|
||||||
|
{ wxDateSpan::Month(), "month" },
|
||||||
|
{ wxDateSpan::Year(), "year" },
|
||||||
|
{ wxDateSpan(1, 2, 3, 4), "year, 2 months, 3 weeks, 4 days" },
|
||||||
|
};
|
||||||
|
|
||||||
|
wxDateTime dt(29, wxDateTime::Dec, 1999), dt1, dt2;
|
||||||
|
|
||||||
|
for ( size_t n = 0; n < WXSIZEOF(testArithmData); n++ )
|
||||||
|
{
|
||||||
|
wxDateSpan span = testArithmData[n].span;
|
||||||
|
dt1 = dt + span;
|
||||||
|
dt2 = dt - span;
|
||||||
|
|
||||||
|
const char *name = testArithmData[n].name;
|
||||||
|
printf("%s + %s = %s, %s - %s = %s\n",
|
||||||
|
dt.FormatISODate().c_str(), name, dt1.FormatISODate().c_str(),
|
||||||
|
dt.FormatISODate().c_str(), name, dt2.FormatISODate().c_str());
|
||||||
|
|
||||||
|
printf("Going back: %s", (dt1 - span).FormatISODate().c_str());
|
||||||
|
if ( dt1 - span == dt )
|
||||||
|
{
|
||||||
|
puts(" (ok)");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
printf(" (ERROR: should be %s)\n", dt.FormatISODate().c_str());
|
||||||
|
}
|
||||||
|
|
||||||
|
printf("Going forward: %s", (dt2 + span).FormatISODate().c_str());
|
||||||
|
if ( dt2 + span == dt )
|
||||||
|
{
|
||||||
|
puts(" (ok)");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
printf(" (ERROR: should be %s)\n", dt.FormatISODate().c_str());
|
||||||
|
}
|
||||||
|
|
||||||
|
printf("Double increment: %s", (dt2 + 2*span).FormatISODate().c_str());
|
||||||
|
if ( dt2 + 2*span == dt1 )
|
||||||
|
{
|
||||||
|
puts(" (ok)");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
printf(" (ERROR: should be %s)\n", dt2.FormatISODate().c_str());
|
||||||
|
}
|
||||||
|
|
||||||
|
puts("");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
|
|
||||||
// test compatibility with the old wxDate/wxTime classes
|
// test compatibility with the old wxDate/wxTime classes
|
||||||
@@ -1479,20 +1638,23 @@ int main(int argc, char **argv)
|
|||||||
#endif // TEST_MIME
|
#endif // TEST_MIME
|
||||||
|
|
||||||
#ifdef TEST_TIME
|
#ifdef TEST_TIME
|
||||||
if ( 1 )
|
if ( 0 )
|
||||||
{
|
{
|
||||||
TestTimeSet();
|
TestTimeSet();
|
||||||
TestTimeStatic();
|
TestTimeStatic();
|
||||||
TestTimeZones();
|
TestTimeRange();
|
||||||
TestTimeRange();
|
TestTimeZones();
|
||||||
TestTimeTicks();
|
TestTimeTicks();
|
||||||
TestTimeJDN();
|
TestTimeJDN();
|
||||||
TestTimeDST();
|
TestTimeDST();
|
||||||
TestTimeWDays();
|
TestTimeWDays();
|
||||||
TestTimeWNumber();
|
TestTimeWNumber();
|
||||||
TestTimeParse();
|
TestTimeParse();
|
||||||
TestTimeFormat();
|
TestTimeFormat();
|
||||||
|
TestTimeArithmetics();
|
||||||
}
|
}
|
||||||
|
if ( 0 )
|
||||||
|
TestInteractive();
|
||||||
#endif // TEST_TIME
|
#endif // TEST_TIME
|
||||||
|
|
||||||
wxUninitialize();
|
wxUninitialize();
|
||||||
|
@@ -65,7 +65,7 @@
|
|||||||
#include "wx/spinctrl.h"
|
#include "wx/spinctrl.h"
|
||||||
#endif // wxUSE_SPINCTRL
|
#endif // wxUSE_SPINCTRL
|
||||||
|
|
||||||
#include "wx/generic/calctrl.h"
|
#include "wx/calctrl.h"
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
// class definitions
|
// class definitions
|
||||||
@@ -113,6 +113,8 @@ public:
|
|||||||
void OnEnableAll(wxCommandEvent& event);
|
void OnEnableAll(wxCommandEvent& event);
|
||||||
void OnChangeColour(wxCommandEvent& event);
|
void OnChangeColour(wxCommandEvent& event);
|
||||||
|
|
||||||
|
void OnCalendarChange(wxCalendarEvent& event);
|
||||||
|
|
||||||
wxListBox *m_listbox,
|
wxListBox *m_listbox,
|
||||||
*m_listboxSorted;
|
*m_listboxSorted;
|
||||||
wxChoice *m_choice,
|
wxChoice *m_choice,
|
||||||
@@ -141,6 +143,9 @@ public:
|
|||||||
|
|
||||||
wxStaticText *m_label;
|
wxStaticText *m_label;
|
||||||
|
|
||||||
|
wxCalendarCtrl *m_calendar;
|
||||||
|
wxStaticText *m_date;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
DECLARE_EVENT_TABLE()
|
DECLARE_EVENT_TABLE()
|
||||||
};
|
};
|
||||||
@@ -260,7 +265,7 @@ bool MyApp::OnInit()
|
|||||||
frame->Show(TRUE);
|
frame->Show(TRUE);
|
||||||
frame->SetCursor(wxCursor(wxCURSOR_HAND));
|
frame->SetCursor(wxCursor(wxCURSOR_HAND));
|
||||||
|
|
||||||
frame->GetPanel()->m_notebook->SetSelection(5);
|
frame->GetPanel()->m_notebook->SetSelection(6);
|
||||||
|
|
||||||
SetTopWindow(frame);
|
SetTopWindow(frame);
|
||||||
|
|
||||||
@@ -323,6 +328,8 @@ const int ID_SPINCTRL = 185;
|
|||||||
|
|
||||||
const int ID_CHANGE_COLOUR = 200;
|
const int ID_CHANGE_COLOUR = 200;
|
||||||
|
|
||||||
|
const int ID_CALENDAR = 210;
|
||||||
|
|
||||||
BEGIN_EVENT_TABLE(MyPanel, wxPanel)
|
BEGIN_EVENT_TABLE(MyPanel, wxPanel)
|
||||||
EVT_SIZE ( MyPanel::OnSize)
|
EVT_SIZE ( MyPanel::OnSize)
|
||||||
EVT_NOTEBOOK_PAGE_CHANGING(ID_NOTEBOOK, MyPanel::OnPageChanging)
|
EVT_NOTEBOOK_PAGE_CHANGING(ID_NOTEBOOK, MyPanel::OnPageChanging)
|
||||||
@@ -373,12 +380,15 @@ EVT_SPINCTRL (ID_SPINCTRL, MyPanel::OnSpinCtrl)
|
|||||||
#endif // wxUSE_SPINCTRL
|
#endif // wxUSE_SPINCTRL
|
||||||
EVT_BUTTON (ID_BUTTON_LABEL, MyPanel::OnUpdateLabel)
|
EVT_BUTTON (ID_BUTTON_LABEL, MyPanel::OnUpdateLabel)
|
||||||
EVT_CHECKBOX (ID_CHANGE_COLOUR, MyPanel::OnChangeColour)
|
EVT_CHECKBOX (ID_CHANGE_COLOUR, MyPanel::OnChangeColour)
|
||||||
|
EVT_CALENDAR (ID_CALENDAR, MyPanel::OnCalendarChange)
|
||||||
END_EVENT_TABLE()
|
END_EVENT_TABLE()
|
||||||
|
|
||||||
MyPanel::MyPanel( wxFrame *frame, int x, int y, int w, int h )
|
MyPanel::MyPanel( wxFrame *frame, int x, int y, int w, int h )
|
||||||
: wxPanel( frame, -1, wxPoint(x, y), wxSize(w, h) ),
|
: wxPanel( frame, -1, wxPoint(x, y), wxSize(w, h) ),
|
||||||
m_text(NULL), m_notebook(NULL)
|
m_text(NULL), m_notebook(NULL)
|
||||||
{
|
{
|
||||||
|
wxLayoutConstraints *c;
|
||||||
|
|
||||||
m_text = new wxTextCtrl( this, -1, "This is the log window.\n", wxPoint(0,50), wxSize(100,50), wxTE_MULTILINE );
|
m_text = new wxTextCtrl( this, -1, "This is the log window.\n", wxPoint(0,50), wxSize(100,50), wxTE_MULTILINE );
|
||||||
// m_text->SetBackgroundColour("wheat");
|
// m_text->SetBackgroundColour("wheat");
|
||||||
|
|
||||||
@@ -643,55 +653,74 @@ MyPanel::MyPanel( wxFrame *frame, int x, int y, int w, int h )
|
|||||||
|
|
||||||
m_notebook->AddPage(panel, "wxBitmapXXX");
|
m_notebook->AddPage(panel, "wxBitmapXXX");
|
||||||
|
|
||||||
|
// wxCalendarCtrl
|
||||||
|
|
||||||
panel = new wxPanel(m_notebook);
|
panel = new wxPanel(m_notebook);
|
||||||
(void)new wxCalendarCtrl(panel, -1);
|
panel->SetAutoLayout( TRUE );
|
||||||
|
|
||||||
|
wxString date;
|
||||||
|
date.Printf("Selected date: %s",
|
||||||
|
wxDateTime::Today().FormatISODate().c_str());
|
||||||
|
m_date = new wxStaticText(panel, -1, date);
|
||||||
|
m_calendar = new wxCalendarCtrl(panel, ID_CALENDAR);
|
||||||
|
|
||||||
|
c = new wxLayoutConstraints;
|
||||||
|
c->left.SameAs( panel, wxLeft, 10 );
|
||||||
|
c->centreY.SameAs( m_calendar, wxCentreY );
|
||||||
|
c->height.AsIs();
|
||||||
|
c->width.AsIs();
|
||||||
|
|
||||||
|
m_date->SetConstraints(c);
|
||||||
|
|
||||||
|
c = new wxLayoutConstraints;
|
||||||
|
c->left.SameAs( m_date, wxRight, 10 );
|
||||||
|
c->top.SameAs( panel, wxTop, 10 );
|
||||||
|
c->height.AsIs();
|
||||||
|
c->width.AsIs();
|
||||||
|
|
||||||
|
m_calendar->SetConstraints(c);
|
||||||
|
|
||||||
m_notebook->AddPage(panel, "wxCalendar");
|
m_notebook->AddPage(panel, "wxCalendar");
|
||||||
|
|
||||||
// --------------- TEST CODE ----------------------
|
// layout constraints
|
||||||
|
|
||||||
// layout constraints
|
panel = new wxPanel(m_notebook);
|
||||||
|
panel->SetAutoLayout( TRUE );
|
||||||
|
|
||||||
panel = new wxPanel(m_notebook);
|
c = new wxLayoutConstraints;
|
||||||
panel->SetAutoLayout( TRUE );
|
c->top.SameAs( panel, wxTop, 10 );
|
||||||
|
c->height.AsIs( );
|
||||||
|
c->left.SameAs( panel, wxLeft, 10 );
|
||||||
|
c->width.PercentOf( panel, wxWidth, 40 );
|
||||||
|
|
||||||
wxLayoutConstraints *c;
|
wxButton *pMyButton = new wxButton(panel, -1, "Test Button" );
|
||||||
c = new wxLayoutConstraints;
|
pMyButton->SetConstraints( c );
|
||||||
c->top.SameAs( panel, wxTop, 10 );
|
|
||||||
c->height.AsIs( );
|
|
||||||
c->left.SameAs( panel, wxLeft, 10 );
|
|
||||||
c->width.PercentOf( panel, wxWidth, 40 );
|
|
||||||
|
|
||||||
wxButton *pMyButton = new wxButton(panel, -1, "Test Button" );
|
c = new wxLayoutConstraints;
|
||||||
pMyButton->SetConstraints( c );
|
c->top.SameAs( panel, wxTop, 10 );
|
||||||
|
c->bottom.SameAs( panel, wxBottom, 10 );
|
||||||
|
c->right.SameAs( panel, wxRight, 10 );
|
||||||
|
c->width.PercentOf( panel, wxWidth, 40 );
|
||||||
|
|
||||||
c = new wxLayoutConstraints;
|
wxButton *pMyButton2 = new wxButton(panel, -1, "Test Button 2" );
|
||||||
c->top.SameAs( panel, wxTop, 10 );
|
pMyButton2->SetConstraints( c );
|
||||||
c->bottom.SameAs( panel, wxBottom, 10 );
|
|
||||||
c->right.SameAs( panel, wxRight, 10 );
|
|
||||||
c->width.PercentOf( panel, wxWidth, 40 );
|
|
||||||
|
|
||||||
wxButton *pMyButton2 = new wxButton(panel, -1, "Test Button 2" );
|
m_notebook->AddPage(panel, "wxLayoutConstraint");
|
||||||
pMyButton2->SetConstraints( c );
|
|
||||||
|
|
||||||
m_notebook->AddPage(panel, "wxLayoutConstraint");
|
// sizer
|
||||||
|
|
||||||
// sizer
|
panel = new wxPanel(m_notebook);
|
||||||
|
panel->SetAutoLayout( TRUE );
|
||||||
|
|
||||||
panel = new wxPanel(m_notebook);
|
wxBoxSizer *sizer = new wxBoxSizer( wxHORIZONTAL );
|
||||||
panel->SetAutoLayout( TRUE );
|
|
||||||
|
|
||||||
wxBoxSizer *sizer = new wxBoxSizer( wxHORIZONTAL );
|
sizer->Add( new wxButton(panel, -1, "Test Button" ), 3, wxALL, 10 );
|
||||||
|
sizer->Add( 20,20, 1 );
|
||||||
|
sizer->Add( new wxButton(panel, -1, "Test Button 2" ), 3, wxGROW|wxALL, 10 );
|
||||||
|
|
||||||
sizer->Add( new wxButton(panel, -1, "Test Button" ), 3, wxALL, 10 );
|
panel->SetSizer( sizer );
|
||||||
sizer->Add( 20,20, 1 );
|
|
||||||
sizer->Add( new wxButton(panel, -1, "Test Button 2" ), 3, wxGROW|wxALL, 10 );
|
|
||||||
|
|
||||||
panel->SetSizer( sizer );
|
|
||||||
|
|
||||||
m_notebook->AddPage(panel, "wxSizer");
|
|
||||||
|
|
||||||
// --------------- TEST CODE ----------------------
|
|
||||||
|
|
||||||
|
m_notebook->AddPage(panel, "wxSizer");
|
||||||
}
|
}
|
||||||
|
|
||||||
void MyPanel::OnSize( wxSizeEvent& WXUNUSED(event) )
|
void MyPanel::OnSize( wxSizeEvent& WXUNUSED(event) )
|
||||||
@@ -729,6 +758,14 @@ void MyPanel::OnPageChanged( wxNotebookEvent &event )
|
|||||||
*m_text << "Notebook selection is " << event.GetSelection() << "\n";
|
*m_text << "Notebook selection is " << event.GetSelection() << "\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MyPanel::OnCalendarChange(wxCalendarEvent& event)
|
||||||
|
{
|
||||||
|
wxString s;
|
||||||
|
s.Printf("Selected date: %s", event.GetDate().FormatISODate().c_str());
|
||||||
|
|
||||||
|
m_date->SetLabel(s);
|
||||||
|
}
|
||||||
|
|
||||||
void MyPanel::OnChangeColour(wxCommandEvent& WXUNUSED(event))
|
void MyPanel::OnChangeColour(wxCommandEvent& WXUNUSED(event))
|
||||||
{
|
{
|
||||||
static wxColour s_colOld;
|
static wxColour s_colOld;
|
||||||
|
@@ -442,14 +442,14 @@ void wxDateTime::Tm::AddMonths(int monDiff)
|
|||||||
void wxDateTime::Tm::AddDays(int dayDiff)
|
void wxDateTime::Tm::AddDays(int dayDiff)
|
||||||
{
|
{
|
||||||
// normalize the days field
|
// normalize the days field
|
||||||
mday += dayDiff;
|
while ( dayDiff + mday < 1 )
|
||||||
while ( mday < 1 )
|
|
||||||
{
|
{
|
||||||
AddMonths(-1);
|
AddMonths(-1);
|
||||||
|
|
||||||
mday += GetNumOfDaysInMonth(year, mon);
|
dayDiff += GetNumOfDaysInMonth(year, mon);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
mday += dayDiff;
|
||||||
while ( mday > GetNumOfDaysInMonth(year, mon) )
|
while ( mday > GetNumOfDaysInMonth(year, mon) )
|
||||||
{
|
{
|
||||||
mday -= GetNumOfDaysInMonth(year, mon);
|
mday -= GetNumOfDaysInMonth(year, mon);
|
||||||
@@ -1035,8 +1035,7 @@ wxDateTime& wxDateTime::Set(wxDateTime_t hour,
|
|||||||
_T("Invalid time in wxDateTime::Set()") );
|
_T("Invalid time in wxDateTime::Set()") );
|
||||||
|
|
||||||
// get the current date from system
|
// get the current date from system
|
||||||
time_t timet = GetTimeNow();
|
struct tm *tm = GetTmNow();
|
||||||
struct tm *tm = localtime(&timet);
|
|
||||||
|
|
||||||
wxCHECK_MSG( tm, wxInvalidDateTime, _T("localtime() failed") );
|
wxCHECK_MSG( tm, wxInvalidDateTime, _T("localtime() failed") );
|
||||||
|
|
||||||
@@ -1125,6 +1124,23 @@ wxDateTime& wxDateTime::Set(double jdn)
|
|||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
wxDateTime& wxDateTime::ResetTime()
|
||||||
|
{
|
||||||
|
Tm tm = GetTm();
|
||||||
|
|
||||||
|
if ( tm.hour || tm.min || tm.sec || tm.msec )
|
||||||
|
{
|
||||||
|
tm.msec =
|
||||||
|
tm.sec =
|
||||||
|
tm.min =
|
||||||
|
tm.hour = 0;
|
||||||
|
|
||||||
|
Set(tm);
|
||||||
|
}
|
||||||
|
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
// time_t <-> broken down time conversions
|
// time_t <-> broken down time conversions
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
@@ -1152,11 +1168,11 @@ wxDateTime::Tm wxDateTime::GetTm(const TimeZone& tz) const
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
time += tz.GetOffset();
|
time += tz.GetOffset();
|
||||||
#ifdef __VMS__ /* time is unsigned so VMS gives a warning on the original */
|
#ifdef __VMS__ // time is unsigned so avoid warning
|
||||||
time2 = (int) time;
|
time2 = (int) time;
|
||||||
if ( time2 >= 0 )
|
if ( time2 >= 0 )
|
||||||
#else
|
#else
|
||||||
if ( time >= 0 )
|
if ( time >= 0 )
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
tm = gmtime(&time);
|
tm = gmtime(&time);
|
||||||
@@ -1349,6 +1365,9 @@ wxDateTime& wxDateTime::Add(const wxDateSpan& diff)
|
|||||||
|
|
||||||
Set(tm);
|
Set(tm);
|
||||||
|
|
||||||
|
wxASSERT_MSG( IsSameTime(tm),
|
||||||
|
_T("Add(wxDateSpan) shouldn't modify time") );
|
||||||
|
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1508,48 +1527,50 @@ wxDateTime::wxDateTime_t wxDateTime::GetDayOfYear(const TimeZone& tz) const
|
|||||||
return gs_cumulatedDays[IsLeapYear(tm.year)][tm.mon] + tm.mday;
|
return gs_cumulatedDays[IsLeapYear(tm.year)][tm.mon] + tm.mday;
|
||||||
}
|
}
|
||||||
|
|
||||||
wxDateTime::wxDateTime_t wxDateTime::GetWeekOfYear(const TimeZone& tz) const
|
wxDateTime::wxDateTime_t wxDateTime::GetWeekOfYear(wxDateTime::WeekFlags flags,
|
||||||
|
const TimeZone& tz) const
|
||||||
{
|
{
|
||||||
#if 1
|
if ( flags == Default_First )
|
||||||
// the first week of the year is the one which contains Jan, 4 (according
|
{
|
||||||
// to ISO standard rule), so the year day N0 = 4 + 7*W always lies in the
|
flags = GetCountry() == USA ? Sunday_First : Monday_First;
|
||||||
// week W+1. As any day N = 7*W + 4 + (N - 4)%7, it lies in the same week
|
}
|
||||||
// as N0 or in the next one.
|
|
||||||
|
|
||||||
// TODO this surely may be optimized - I got confused while writing it
|
|
||||||
|
|
||||||
wxDateTime_t nDayInYear = GetDayOfYear(tz);
|
wxDateTime_t nDayInYear = GetDayOfYear(tz);
|
||||||
|
wxDateTime_t week;
|
||||||
|
|
||||||
// the week day of the day lying in the first week
|
WeekDay wd = GetWeekDay(tz);
|
||||||
WeekDay wdayStart = wxDateTime(4, Jan, GetYear()).GetWeekDay();
|
if ( flags == Sunday_First )
|
||||||
|
{
|
||||||
|
week = (nDayInYear - wd + 7) / 7;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// have to shift the week days values
|
||||||
|
week = (nDayInYear - (wd - 1 + 7) % 7 + 7) / 7;
|
||||||
|
}
|
||||||
|
|
||||||
wxDateTime_t week = (nDayInYear - 4) / 7 + 1;
|
// FIXME some more elegant way??
|
||||||
|
WeekDay wdYearStart = wxDateTime(1, Jan, GetYear()).GetWeekDay();
|
||||||
// notice that Sunday shoould be counted as 7, not 0 here!
|
if ( wdYearStart == Wed || wdYearStart == Thu )
|
||||||
if ( ((nDayInYear - 4) % 7) + (!wdayStart ? 7 : wdayStart) > 7 )
|
|
||||||
{
|
{
|
||||||
week++;
|
week++;
|
||||||
}
|
}
|
||||||
|
|
||||||
return week;
|
return week;
|
||||||
#else // 0
|
|
||||||
// an attempt at doing it simpler - but this doesn't quite work...
|
|
||||||
return (WeekDay)((GetDayOfYear(tz) - (GetWeekDay(tz) - 1 + 7) % 7 + 7) / 7);
|
|
||||||
#endif // 0/1
|
|
||||||
}
|
}
|
||||||
|
|
||||||
wxDateTime::wxDateTime_t wxDateTime::GetWeekOfMonth(const TimeZone& tz) const
|
wxDateTime::wxDateTime_t wxDateTime::GetWeekOfMonth(wxDateTime::WeekFlags flags,
|
||||||
|
const TimeZone& tz) const
|
||||||
{
|
{
|
||||||
size_t nWeek = 0;
|
Tm tm = GetTm(tz);
|
||||||
|
wxDateTime dtMonthStart = wxDateTime(1, tm.mon, tm.year);
|
||||||
wxDateTime dt(*this);
|
size_t nWeek = GetWeekOfYear(flags) - dtMonthStart.GetWeekOfYear(flags) + 1;
|
||||||
do
|
if ( nWeek < 0 )
|
||||||
{
|
{
|
||||||
nWeek++;
|
// this may happen for January when Jan, 1 is the last week of the
|
||||||
|
// previous year
|
||||||
dt -= wxTimeSpan::Week();
|
nWeek += IsLeapYear(tm.year - 1) ? 53 : 52;
|
||||||
}
|
}
|
||||||
while ( dt.GetMonth(tz) == GetMonth(tz) );
|
|
||||||
|
|
||||||
return nWeek;
|
return nWeek;
|
||||||
}
|
}
|
||||||
@@ -1936,14 +1957,11 @@ restart:
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case _T('U'): // week number in the year (Sunday 1st week day)
|
case _T('U'): // week number in the year (Sunday 1st week day)
|
||||||
{
|
res += wxString::Format(fmt, GetWeekOfYear(Sunday_First, tz));
|
||||||
int week = (GetDayOfYear(tz) - tm.GetWeekDay() + 7) / 7;
|
|
||||||
res += wxString::Format(fmt, week);
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case _T('W'): // week number in the year (Monday 1st week day)
|
case _T('W'): // week number in the year (Monday 1st week day)
|
||||||
res += wxString::Format(fmt, GetWeekOfYear(tz));
|
res += wxString::Format(fmt, GetWeekOfYear(Monday_First, tz));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case _T('w'): // weekday as a number (0-6), Sunday = 0
|
case _T('w'): // weekday as a number (0-6), Sunday = 0
|
||||||
@@ -2896,7 +2914,7 @@ const wxChar *wxDateTime::ParseDate(const wxChar *date)
|
|||||||
int year = 0;
|
int year = 0;
|
||||||
|
|
||||||
// tokenize the string
|
// tokenize the string
|
||||||
wxStringTokenizer tok(p, _T(",/-\t "));
|
wxStringTokenizer tok(p, _T(",/-\t\n "));
|
||||||
while ( tok.HasMoreTokens() )
|
while ( tok.HasMoreTokens() )
|
||||||
{
|
{
|
||||||
wxString token = tok.GetNextToken();
|
wxString token = tok.GetNextToken();
|
||||||
|
@@ -29,9 +29,12 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef WX_PRECOMP
|
#ifndef WX_PRECOMP
|
||||||
|
#include "wx/dcclient.h"
|
||||||
|
#include "wx/settings.h"
|
||||||
|
#include "wx/brush.h"
|
||||||
#endif //WX_PRECOMP
|
#endif //WX_PRECOMP
|
||||||
|
|
||||||
#include "wx/generic/calctrl.h"
|
#include "wx/calctrl.h"
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
// wxWin macros
|
// wxWin macros
|
||||||
@@ -40,7 +43,12 @@
|
|||||||
BEGIN_EVENT_TABLE(wxCalendarCtrl, wxControl)
|
BEGIN_EVENT_TABLE(wxCalendarCtrl, wxControl)
|
||||||
EVT_PAINT(wxCalendarCtrl::OnPaint)
|
EVT_PAINT(wxCalendarCtrl::OnPaint)
|
||||||
|
|
||||||
|
EVT_CHAR(wxCalendarCtrl::OnChar)
|
||||||
|
|
||||||
EVT_LEFT_DOWN(wxCalendarCtrl::OnClick)
|
EVT_LEFT_DOWN(wxCalendarCtrl::OnClick)
|
||||||
|
|
||||||
|
EVT_COMBOBOX(-1, wxCalendarCtrl::OnMonthChange)
|
||||||
|
EVT_SPINCTRL(-1, wxCalendarCtrl::OnYearChange)
|
||||||
END_EVENT_TABLE()
|
END_EVENT_TABLE()
|
||||||
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxCalendarCtrl, wxControl)
|
IMPLEMENT_DYNAMIC_CLASS(wxCalendarCtrl, wxControl)
|
||||||
@@ -60,6 +68,12 @@ void wxCalendarCtrl::Init()
|
|||||||
|
|
||||||
m_widthCol =
|
m_widthCol =
|
||||||
m_heightRow = 0;
|
m_heightRow = 0;
|
||||||
|
|
||||||
|
wxDateTime::WeekDay wd;
|
||||||
|
for ( wd = wxDateTime::Sun; wd < wxDateTime::Inv_WeekDay; wxNextWDay(wd) )
|
||||||
|
{
|
||||||
|
m_weekdays[wd] = wxDateTime::GetWeekDayName(wd, wxDateTime::Name_Abbr);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxCalendarCtrl::Create(wxWindow *parent,
|
bool wxCalendarCtrl::Create(wxWindow *parent,
|
||||||
@@ -72,6 +86,31 @@ bool wxCalendarCtrl::Create(wxWindow *parent,
|
|||||||
{
|
{
|
||||||
m_date = date.IsValid() ? date : wxDateTime::Today();
|
m_date = date.IsValid() ? date : wxDateTime::Today();
|
||||||
|
|
||||||
|
wxString monthNames[12];
|
||||||
|
wxDateTime::Month m;
|
||||||
|
for ( m = wxDateTime::Jan; m < wxDateTime::Inv_Month; wxNextMonth(m) )
|
||||||
|
{
|
||||||
|
monthNames[m] = wxDateTime::GetMonthName(m);
|
||||||
|
}
|
||||||
|
|
||||||
|
m_comboMonth = new wxComboBox(parent, -1,
|
||||||
|
monthNames[m_date.GetMonth()],
|
||||||
|
wxDefaultPosition,
|
||||||
|
wxDefaultSize,
|
||||||
|
WXSIZEOF(monthNames), monthNames,
|
||||||
|
wxCB_READONLY);
|
||||||
|
|
||||||
|
m_spinYear = new wxSpinCtrl(parent, -1,
|
||||||
|
m_date.Format(_T("%Y")),
|
||||||
|
wxDefaultPosition,
|
||||||
|
wxDefaultSize,
|
||||||
|
wxSP_ARROW_KEYS,
|
||||||
|
-4300, 10000, m_date.GetYear());
|
||||||
|
|
||||||
|
// we want to process the events from these controls
|
||||||
|
m_comboMonth->PushEventHandler(this);
|
||||||
|
m_spinYear->PushEventHandler(this);
|
||||||
|
|
||||||
wxSize sizeReal;
|
wxSize sizeReal;
|
||||||
if ( size.x == -1 || size.y == -1 )
|
if ( size.x == -1 || size.y == -1 )
|
||||||
{
|
{
|
||||||
@@ -89,10 +128,76 @@ bool wxCalendarCtrl::Create(wxWindow *parent,
|
|||||||
SetSize(sizeReal);
|
SetSize(sizeReal);
|
||||||
|
|
||||||
SetBackgroundColour(*wxWHITE);
|
SetBackgroundColour(*wxWHITE);
|
||||||
|
SetFont(*wxSWISS_FONT);
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
// changing date
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
void wxCalendarCtrl::SetDate(const wxDateTime& date)
|
||||||
|
{
|
||||||
|
if ( m_date.GetMonth() == date.GetMonth() &&
|
||||||
|
m_date.GetYear() == date.GetYear() )
|
||||||
|
{
|
||||||
|
// just change the day
|
||||||
|
ChangeDay(date);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// change everything
|
||||||
|
m_date = date;
|
||||||
|
|
||||||
|
// update the controls
|
||||||
|
m_comboMonth->SetSelection(m_date.GetMonth());
|
||||||
|
m_spinYear->SetValue(m_date.Format(_T("%Y")));
|
||||||
|
|
||||||
|
// update the calendar
|
||||||
|
Refresh();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxCalendarCtrl::ChangeDay(const wxDateTime& date)
|
||||||
|
{
|
||||||
|
if ( m_date != date )
|
||||||
|
{
|
||||||
|
// we need to refresh the row containing the old date and the one
|
||||||
|
// containing the new one
|
||||||
|
wxDateTime dateOld = m_date;
|
||||||
|
m_date = date;
|
||||||
|
|
||||||
|
RefreshDate(dateOld);
|
||||||
|
|
||||||
|
// if the date is in the same row, it was already drawn correctly
|
||||||
|
if ( GetWeek(m_date) != GetWeek(dateOld) )
|
||||||
|
{
|
||||||
|
RefreshDate(m_date);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxCalendarCtrl::SetDateAndNotify(const wxDateTime& date)
|
||||||
|
{
|
||||||
|
wxDateTime::Tm tm1 = m_date.GetTm(),
|
||||||
|
tm2 = date.GetTm();
|
||||||
|
|
||||||
|
wxEventType type;
|
||||||
|
if ( tm1.year != tm2.year )
|
||||||
|
type = wxEVT_CALENDAR_YEAR_CHANGED;
|
||||||
|
else if ( tm1.mon != tm2.mon )
|
||||||
|
type = wxEVT_CALENDAR_MONTH_CHANGED;
|
||||||
|
else if ( tm1.mday != tm2.mday )
|
||||||
|
type = wxEVT_CALENDAR_DAY_CHANGED;
|
||||||
|
else
|
||||||
|
return;
|
||||||
|
|
||||||
|
SetDate(date);
|
||||||
|
|
||||||
|
GenerateEvent(type);
|
||||||
|
}
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
// date helpers
|
// date helpers
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
@@ -102,7 +207,14 @@ wxDateTime wxCalendarCtrl::GetStartDate() const
|
|||||||
wxDateTime::Tm tm = m_date.GetTm();
|
wxDateTime::Tm tm = m_date.GetTm();
|
||||||
|
|
||||||
wxDateTime date = wxDateTime(1, tm.mon, tm.year);
|
wxDateTime date = wxDateTime(1, tm.mon, tm.year);
|
||||||
date.SetToPrevWeekDay(wxDateTime::Sun);
|
if ( date.GetWeekDay() != wxDateTime::Sun )
|
||||||
|
{
|
||||||
|
date.SetToPrevWeekDay(wxDateTime::Sun);
|
||||||
|
|
||||||
|
// be sure to do it or it might gain 1 hour if DST changed in between
|
||||||
|
date.ResetTime();
|
||||||
|
}
|
||||||
|
//else: we already have it
|
||||||
|
|
||||||
return date;
|
return date;
|
||||||
}
|
}
|
||||||
@@ -112,13 +224,37 @@ bool wxCalendarCtrl::IsDateShown(const wxDateTime& date) const
|
|||||||
return date.GetMonth() == m_date.GetMonth();
|
return date.GetMonth() == m_date.GetMonth();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
size_t wxCalendarCtrl::GetWeek(const wxDateTime& date) const
|
||||||
|
{
|
||||||
|
return date.GetWeekOfMonth(wxDateTime::Sunday_First);
|
||||||
|
}
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
// size management
|
// size management
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
// this is a composite control and it must arrange its parts each time its
|
||||||
|
// size or position changes: the combobox and spinctrl are along the top of
|
||||||
|
// the available area and the calendar takes up therest of the space
|
||||||
|
|
||||||
|
// the constants used for the layout
|
||||||
|
#define VERT_MARGIN 5 // distance between combo and calendar
|
||||||
|
#define HORZ_MARGIN 15 // spin
|
||||||
|
|
||||||
wxSize wxCalendarCtrl::DoGetBestSize() const
|
wxSize wxCalendarCtrl::DoGetBestSize() const
|
||||||
{
|
{
|
||||||
return wxSize(230, 200);
|
// calc the size of the calendar
|
||||||
|
((wxCalendarCtrl *)this)->RecalcGeometry(); // const_cast
|
||||||
|
|
||||||
|
wxCoord width = 7*m_widthCol,
|
||||||
|
height = 7*m_heightRow;
|
||||||
|
|
||||||
|
wxSize sizeCombo = m_comboMonth->GetBestSize(),
|
||||||
|
sizeSpin = m_spinYear->GetBestSize();
|
||||||
|
|
||||||
|
height += VERT_MARGIN + wxMax(sizeCombo.y, sizeSpin.y);
|
||||||
|
|
||||||
|
return wxSize(width, height);
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxCalendarCtrl::DoSetSize(int x, int y,
|
void wxCalendarCtrl::DoSetSize(int x, int y,
|
||||||
@@ -130,7 +266,44 @@ void wxCalendarCtrl::DoSetSize(int x, int y,
|
|||||||
|
|
||||||
void wxCalendarCtrl::DoMoveWindow(int x, int y, int width, int height)
|
void wxCalendarCtrl::DoMoveWindow(int x, int y, int width, int height)
|
||||||
{
|
{
|
||||||
wxControl::DoMoveWindow(x, y, width, height);
|
wxSize sizeCombo = m_comboMonth->GetSize();
|
||||||
|
m_comboMonth->Move(x, y);
|
||||||
|
|
||||||
|
int xDiff = sizeCombo.x + HORZ_MARGIN;
|
||||||
|
m_spinYear->SetSize(x + xDiff, y, width - xDiff, -1);
|
||||||
|
|
||||||
|
wxSize sizeSpin = m_spinYear->GetSize();
|
||||||
|
int yDiff = wxMax(sizeSpin.y, sizeCombo.y) + VERT_MARGIN;
|
||||||
|
|
||||||
|
wxControl::DoMoveWindow(x, y + yDiff, width, height - yDiff);
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxCalendarCtrl::RecalcGeometry()
|
||||||
|
{
|
||||||
|
if ( m_widthCol != 0 )
|
||||||
|
return;
|
||||||
|
|
||||||
|
wxClientDC dc(this);
|
||||||
|
|
||||||
|
dc.SetFont(m_font);
|
||||||
|
|
||||||
|
// determine the column width (we assume that the weekday names are always
|
||||||
|
// wider (in any language) than the numbers)
|
||||||
|
m_widthCol = 0;
|
||||||
|
wxDateTime::WeekDay wd;
|
||||||
|
for ( wd = wxDateTime::Sun; wd < wxDateTime::Inv_WeekDay; wxNextWDay(wd) )
|
||||||
|
{
|
||||||
|
wxCoord width;
|
||||||
|
dc.GetTextExtent(m_weekdays[wd], &width, &m_heightRow);
|
||||||
|
if ( width > m_widthCol )
|
||||||
|
{
|
||||||
|
m_widthCol = width;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// leave some margins
|
||||||
|
m_widthCol += 2;
|
||||||
|
m_heightRow += 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
@@ -142,38 +315,29 @@ void wxCalendarCtrl::OnPaint(wxPaintEvent& event)
|
|||||||
wxPaintDC dc(this);
|
wxPaintDC dc(this);
|
||||||
|
|
||||||
wxDateTime::WeekDay wd;
|
wxDateTime::WeekDay wd;
|
||||||
wxString weekdays[7];
|
|
||||||
|
|
||||||
dc.SetFont(*wxSWISS_FONT);
|
dc.SetFont(m_font);
|
||||||
|
|
||||||
// determine the column width (we assume that the weekday names are always
|
RecalcGeometry();
|
||||||
// wider (in any language) than the numbers)
|
|
||||||
m_widthCol = 0;
|
|
||||||
for ( wd = wxDateTime::Sun; wd < wxDateTime::Inv_WeekDay; wxNextWDay(wd) )
|
|
||||||
{
|
|
||||||
weekdays[wd] = wxDateTime::GetWeekDayName(wd, wxDateTime::Name_Abbr);
|
|
||||||
|
|
||||||
wxCoord width;
|
printf("--- starting to paint, selection: %s, week %u\n",
|
||||||
dc.GetTextExtent(weekdays[wd], &width, &m_heightRow);
|
m_date.Format("%a %d-%m-%Y %H:%M:%S").c_str(),
|
||||||
if ( width > m_widthCol )
|
GetWeek(m_date));
|
||||||
{
|
|
||||||
m_widthCol = width;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// leave some margins
|
|
||||||
m_widthCol += 2;
|
|
||||||
m_heightRow += 2;
|
|
||||||
|
|
||||||
// first draw the week days
|
// first draw the week days
|
||||||
dc.SetTextForeground(*wxBLUE);
|
if ( IsExposed(0, 0, 7*m_widthCol, m_heightRow) )
|
||||||
dc.SetBrush(wxBrush(*wxLIGHT_GREY, wxSOLID));
|
|
||||||
dc.SetBackgroundMode(wxTRANSPARENT);
|
|
||||||
dc.SetPen(*wxWHITE_PEN);
|
|
||||||
dc.DrawRectangle(0, 0, 7*m_widthCol - 1, m_heightRow);
|
|
||||||
for ( wd = wxDateTime::Sun; wd < wxDateTime::Inv_WeekDay; wxNextWDay(wd) )
|
|
||||||
{
|
{
|
||||||
dc.DrawText(weekdays[wd], wd*m_widthCol + 1, 0);
|
puts("painting the header");
|
||||||
|
|
||||||
|
dc.SetTextForeground(*wxBLUE);
|
||||||
|
dc.SetBrush(wxBrush(*wxLIGHT_GREY, wxSOLID));
|
||||||
|
dc.SetBackgroundMode(wxTRANSPARENT);
|
||||||
|
dc.SetPen(*wxLIGHT_GREY_PEN);
|
||||||
|
dc.DrawRectangle(0, 0, 7*m_widthCol, m_heightRow);
|
||||||
|
for ( wd = wxDateTime::Sun; wd < wxDateTime::Inv_WeekDay; wxNextWDay(wd) )
|
||||||
|
{
|
||||||
|
dc.DrawText(m_weekdays[wd], wd*m_widthCol + 1, 0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// then the calendar itself
|
// then the calendar itself
|
||||||
@@ -183,9 +347,22 @@ void wxCalendarCtrl::OnPaint(wxPaintEvent& event)
|
|||||||
wxCoord y = m_heightRow;
|
wxCoord y = m_heightRow;
|
||||||
|
|
||||||
wxDateTime date = GetStartDate();
|
wxDateTime date = GetStartDate();
|
||||||
|
printf("starting calendar from %s\n",
|
||||||
|
date.Format("%a %d-%m-%Y %H:%M:%S").c_str());
|
||||||
|
|
||||||
dc.SetBackgroundMode(wxSOLID);
|
dc.SetBackgroundMode(wxSOLID);
|
||||||
for ( size_t nWeek = 0; nWeek < 6; nWeek++ )
|
for ( size_t nWeek = 1; nWeek <= 6; nWeek++, y += m_heightRow )
|
||||||
{
|
{
|
||||||
|
// if the update region doesn't intersect this row, don't paint it
|
||||||
|
if ( !IsExposed(0, y, 7*m_widthCol, y + m_heightRow - 1) )
|
||||||
|
{
|
||||||
|
date += wxDateSpan::Week();
|
||||||
|
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
printf("painting week %d at y = %d\n", nWeek, y);
|
||||||
|
|
||||||
for ( wd = wxDateTime::Sun; wd < wxDateTime::Inv_WeekDay; wxNextWDay(wd) )
|
for ( wd = wxDateTime::Sun; wd < wxDateTime::Inv_WeekDay; wxNextWDay(wd) )
|
||||||
{
|
{
|
||||||
if ( IsDateShown(date) )
|
if ( IsDateShown(date) )
|
||||||
@@ -205,7 +382,7 @@ void wxCalendarCtrl::OnPaint(wxPaintEvent& event)
|
|||||||
|
|
||||||
if ( isSel )
|
if ( isSel )
|
||||||
{
|
{
|
||||||
dc.SetTextForeground(*wxBLACK);
|
dc.SetTextForeground(m_foregroundColour);
|
||||||
dc.SetTextBackground(m_backgroundColour);
|
dc.SetTextBackground(m_backgroundColour);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -213,9 +390,31 @@ void wxCalendarCtrl::OnPaint(wxPaintEvent& event)
|
|||||||
|
|
||||||
date += wxDateSpan::Day();
|
date += wxDateSpan::Day();
|
||||||
}
|
}
|
||||||
|
|
||||||
y += m_heightRow;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
puts("+++ finished painting");
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxCalendarCtrl::RefreshDate(const wxDateTime& date)
|
||||||
|
{
|
||||||
|
RecalcGeometry();
|
||||||
|
|
||||||
|
wxRect rect;
|
||||||
|
|
||||||
|
// always refresh the whole row at once because our OnPaint() will draw
|
||||||
|
// the whole row anyhow - and this allows the small optimisation in
|
||||||
|
// OnClick() below to work
|
||||||
|
rect.x = 0;
|
||||||
|
rect.y = m_heightRow * GetWeek(date);
|
||||||
|
rect.width = 7*m_widthCol;
|
||||||
|
rect.height = m_heightRow;
|
||||||
|
|
||||||
|
printf("*** refreshing week %d at (%d, %d)-(%d, %d)\n",
|
||||||
|
GetWeek(date),
|
||||||
|
rect.x, rect.y,
|
||||||
|
rect.x + rect.width, rect.y + rect.height);
|
||||||
|
|
||||||
|
Refresh(TRUE, &rect);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
@@ -224,6 +423,8 @@ void wxCalendarCtrl::OnPaint(wxPaintEvent& event)
|
|||||||
|
|
||||||
void wxCalendarCtrl::OnClick(wxMouseEvent& event)
|
void wxCalendarCtrl::OnClick(wxMouseEvent& event)
|
||||||
{
|
{
|
||||||
|
RecalcGeometry();
|
||||||
|
|
||||||
wxDateTime date;
|
wxDateTime date;
|
||||||
if ( !HitTest(event.GetPosition(), &date) )
|
if ( !HitTest(event.GetPosition(), &date) )
|
||||||
{
|
{
|
||||||
@@ -231,14 +432,16 @@ void wxCalendarCtrl::OnClick(wxMouseEvent& event)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
m_date = date;
|
ChangeDay(date);
|
||||||
|
|
||||||
Refresh();
|
GenerateEvent(wxEVT_CALENDAR_DAY_CHANGED);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxCalendarCtrl::HitTest(const wxPoint& pos, wxDateTime *date)
|
bool wxCalendarCtrl::HitTest(const wxPoint& pos, wxDateTime *date)
|
||||||
{
|
{
|
||||||
|
RecalcGeometry();
|
||||||
|
|
||||||
wxCoord y = pos.y;
|
wxCoord y = pos.y;
|
||||||
if ( y < m_heightRow )
|
if ( y < m_heightRow )
|
||||||
return FALSE;
|
return FALSE;
|
||||||
@@ -254,5 +457,112 @@ bool wxCalendarCtrl::HitTest(const wxPoint& pos, wxDateTime *date)
|
|||||||
|
|
||||||
*date = GetStartDate();
|
*date = GetStartDate();
|
||||||
*date += wxDateSpan::Days(7*week + wday);
|
*date += wxDateSpan::Days(7*week + wday);
|
||||||
|
|
||||||
return IsDateShown(*date);
|
return IsDateShown(*date);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
// subcontrols events handling
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
void wxCalendarCtrl::OnMonthChange(wxCommandEvent& event)
|
||||||
|
{
|
||||||
|
wxDateTime::Tm tm = m_date.GetTm();
|
||||||
|
|
||||||
|
wxDateTime::Month mon = (wxDateTime::Month)event.GetInt();
|
||||||
|
if ( tm.mday > wxDateTime::GetNumberOfDays(mon, tm.year) )
|
||||||
|
{
|
||||||
|
tm.mday = wxDateTime::GetNumberOfDays(mon, tm.year);
|
||||||
|
}
|
||||||
|
|
||||||
|
SetDate(wxDateTime(tm.mday, mon, tm.year));
|
||||||
|
|
||||||
|
GenerateEvent(wxEVT_CALENDAR_MONTH_CHANGED);
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxCalendarCtrl::OnYearChange(wxSpinEvent& event)
|
||||||
|
{
|
||||||
|
wxDateTime::Tm tm = m_date.GetTm();
|
||||||
|
|
||||||
|
int year = event.GetInt();
|
||||||
|
if ( tm.mday > wxDateTime::GetNumberOfDays(tm.mon, year) )
|
||||||
|
{
|
||||||
|
tm.mday = wxDateTime::GetNumberOfDays(tm.mon, year);
|
||||||
|
}
|
||||||
|
|
||||||
|
SetDate(wxDateTime(tm.mday, tm.mon, year));
|
||||||
|
|
||||||
|
GenerateEvent(wxEVT_CALENDAR_YEAR_CHANGED);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
// keyboard interface
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
void wxCalendarCtrl::OnChar(wxKeyEvent& event)
|
||||||
|
{
|
||||||
|
switch ( event.KeyCode() )
|
||||||
|
{
|
||||||
|
case _T('+'):
|
||||||
|
case WXK_ADD:
|
||||||
|
SetDateAndNotify(m_date + wxDateSpan::Year());
|
||||||
|
break;
|
||||||
|
|
||||||
|
case _T('-'):
|
||||||
|
case WXK_SUBTRACT:
|
||||||
|
SetDateAndNotify(m_date - wxDateSpan::Year());
|
||||||
|
break;
|
||||||
|
|
||||||
|
case WXK_PAGEDOWN:
|
||||||
|
SetDateAndNotify(m_date + wxDateSpan::Year());
|
||||||
|
break;
|
||||||
|
|
||||||
|
case WXK_PAGEUP:
|
||||||
|
SetDateAndNotify(m_date - wxDateSpan::Year());
|
||||||
|
break;
|
||||||
|
|
||||||
|
case WXK_RIGHT:
|
||||||
|
SetDateAndNotify(m_date + wxDateSpan::Day());
|
||||||
|
break;
|
||||||
|
|
||||||
|
case WXK_LEFT:
|
||||||
|
SetDateAndNotify(m_date - wxDateSpan::Day());
|
||||||
|
break;
|
||||||
|
|
||||||
|
case WXK_UP:
|
||||||
|
SetDateAndNotify(m_date - wxDateSpan::Week());
|
||||||
|
break;
|
||||||
|
|
||||||
|
case WXK_DOWN:
|
||||||
|
SetDateAndNotify(m_date + wxDateSpan::Week());
|
||||||
|
break;
|
||||||
|
|
||||||
|
case WXK_HOME:
|
||||||
|
SetDateAndNotify(wxDateTime::Today());
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
event.Skip();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
// wxCalendarEvent
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
void wxCalendarCtrl::GenerateEvent(wxEventType type)
|
||||||
|
{
|
||||||
|
// we're called for a change in some particular date field but we always
|
||||||
|
// also generate a generic "changed" event
|
||||||
|
wxCalendarEvent event(this, type);
|
||||||
|
wxCalendarEvent event2(this, wxEVT_CALENDAR_SEL_CHANGED);
|
||||||
|
|
||||||
|
(void)GetEventHandler()->ProcessEvent(event);
|
||||||
|
(void)GetEventHandler()->ProcessEvent(event2);
|
||||||
|
}
|
||||||
|
|
||||||
|
wxCalendarEvent::wxCalendarEvent(wxCalendarCtrl *cal, wxEventType type)
|
||||||
|
: wxCommandEvent(type, cal->GetId())
|
||||||
|
{
|
||||||
|
m_date = cal->GetDate();
|
||||||
|
}
|
||||||
|
@@ -101,19 +101,21 @@ bool wxComboBox::Create( wxWindow *parent, wxWindowID id, const wxString& value,
|
|||||||
m_needParent = TRUE;
|
m_needParent = TRUE;
|
||||||
m_acceptsFocus = TRUE;
|
m_acceptsFocus = TRUE;
|
||||||
|
|
||||||
wxSize newSize( size );
|
wxSize newSize = size,
|
||||||
|
bestSize = DoGetBestSize();
|
||||||
|
|
||||||
if (newSize.x == -1)
|
if (newSize.x == -1)
|
||||||
newSize.x = 80;
|
newSize.x = bestSize.x;
|
||||||
if (newSize.y == -1)
|
if (newSize.y == -1)
|
||||||
newSize.y = 26;
|
newSize.y = bestSize.y;
|
||||||
if (newSize.y > 30)
|
if (newSize.y > 30)
|
||||||
newSize.y = 30;
|
newSize.y = 30;
|
||||||
|
|
||||||
if (!PreCreation( parent, pos, newSize ) ||
|
if (!PreCreation( parent, pos, newSize ) ||
|
||||||
!CreateBase( parent, id, pos, size, style, validator, name ))
|
!CreateBase( parent, id, pos, size, style, validator, name ))
|
||||||
{
|
{
|
||||||
wxFAIL_MSG( wxT("wxComboBox creation failed") );
|
wxFAIL_MSG( wxT("wxComboBox creation failed") );
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
m_widget = gtk_combo_new();
|
m_widget = gtk_combo_new();
|
||||||
@@ -126,7 +128,7 @@ bool wxComboBox::Create( wxWindow *parent, wxWindowID id, const wxString& value,
|
|||||||
for (int i = 0; i < n; i++)
|
for (int i = 0; i < n; i++)
|
||||||
{
|
{
|
||||||
/* don't send first event, which GTK sends aways when
|
/* don't send first event, which GTK sends aways when
|
||||||
inserting the first item */
|
inserting the first item */
|
||||||
m_alreadySent = TRUE;
|
m_alreadySent = TRUE;
|
||||||
|
|
||||||
GtkWidget *list_item = gtk_list_item_new_with_label( choices[i].mbc_str() );
|
GtkWidget *list_item = gtk_list_item_new_with_label( choices[i].mbc_str() );
|
||||||
@@ -663,6 +665,7 @@ bool wxComboBox::IsOwnGtkWindow( GdkWindow *window )
|
|||||||
|
|
||||||
wxSize wxComboBox::DoGetBestSize() const
|
wxSize wxComboBox::DoGetBestSize() const
|
||||||
{
|
{
|
||||||
|
// totally bogus - should measure the strings in the combo!
|
||||||
return wxSize(100, 26);
|
return wxSize(100, 26);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -99,10 +99,11 @@ bool wxSpinButton::Create(wxWindow *parent,
|
|||||||
{
|
{
|
||||||
m_needParent = TRUE;
|
m_needParent = TRUE;
|
||||||
|
|
||||||
wxSize new_size = size;
|
wxSize new_size = size,
|
||||||
new_size.x = 15;
|
sizeBest = DoGetBestSize();
|
||||||
|
new_size.x = sizeBest.x; // override width always
|
||||||
if (new_size.y == -1)
|
if (new_size.y == -1)
|
||||||
new_size.y = 26;
|
new_size.y = sizeBest.y;
|
||||||
|
|
||||||
if (!PreCreation( parent, pos, new_size ) ||
|
if (!PreCreation( parent, pos, new_size ) ||
|
||||||
!CreateBase( parent, id, pos, new_size, style, wxDefaultValidator, name ))
|
!CreateBase( parent, id, pos, new_size, style, wxDefaultValidator, name ))
|
||||||
@@ -197,7 +198,7 @@ void wxSpinButton::OnSize( wxSizeEvent &WXUNUSED(event) )
|
|||||||
{
|
{
|
||||||
wxCHECK_RET( (m_widget != NULL), wxT("invalid spin button") );
|
wxCHECK_RET( (m_widget != NULL), wxT("invalid spin button") );
|
||||||
|
|
||||||
m_width = 15;
|
m_width = DoGetBestSize().x;
|
||||||
gtk_widget_set_usize( m_widget, m_width, m_height );
|
gtk_widget_set_usize( m_widget, m_width, m_height );
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -212,4 +213,9 @@ void wxSpinButton::ApplyWidgetStyle()
|
|||||||
gtk_widget_set_style( m_widget, m_widgetStyle );
|
gtk_widget_set_style( m_widget, m_widgetStyle );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
wxSize wxSpinButton::DoGetBestSize() const
|
||||||
|
{
|
||||||
|
return wxSize(15, 26);
|
||||||
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@@ -75,9 +75,12 @@ bool wxSpinCtrl::Create(wxWindow *parent, wxWindowID id,
|
|||||||
m_needParent = TRUE;
|
m_needParent = TRUE;
|
||||||
m_acceptsFocus = TRUE;
|
m_acceptsFocus = TRUE;
|
||||||
|
|
||||||
wxSize new_size = size;
|
wxSize new_size = size,
|
||||||
|
sizeBest = DoGetBestSize();
|
||||||
|
if (new_size.x == -1)
|
||||||
|
new_size.x = sizeBest.x;
|
||||||
if (new_size.y == -1)
|
if (new_size.y == -1)
|
||||||
new_size.y = 26;
|
new_size.y = sizeBest.y;
|
||||||
|
|
||||||
if (!PreCreation( parent, pos, new_size ) ||
|
if (!PreCreation( parent, pos, new_size ) ||
|
||||||
!CreateBase( parent, id, pos, new_size, style, wxDefaultValidator, name ))
|
!CreateBase( parent, id, pos, new_size, style, wxDefaultValidator, name ))
|
||||||
@@ -219,5 +222,10 @@ void wxSpinCtrl::ApplyWidgetStyle()
|
|||||||
gtk_widget_set_style( m_widget, m_widgetStyle );
|
gtk_widget_set_style( m_widget, m_widgetStyle );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
wxSize wxSpinCtrl::DoGetBestSize() const
|
||||||
|
{
|
||||||
|
return wxSize(95, 26);
|
||||||
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
// wxUSE_SPINCTRL
|
// wxUSE_SPINCTRL
|
||||||
|
@@ -101,19 +101,21 @@ bool wxComboBox::Create( wxWindow *parent, wxWindowID id, const wxString& value,
|
|||||||
m_needParent = TRUE;
|
m_needParent = TRUE;
|
||||||
m_acceptsFocus = TRUE;
|
m_acceptsFocus = TRUE;
|
||||||
|
|
||||||
wxSize newSize( size );
|
wxSize newSize = size,
|
||||||
|
bestSize = DoGetBestSize();
|
||||||
|
|
||||||
if (newSize.x == -1)
|
if (newSize.x == -1)
|
||||||
newSize.x = 80;
|
newSize.x = bestSize.x;
|
||||||
if (newSize.y == -1)
|
if (newSize.y == -1)
|
||||||
newSize.y = 26;
|
newSize.y = bestSize.y;
|
||||||
if (newSize.y > 30)
|
if (newSize.y > 30)
|
||||||
newSize.y = 30;
|
newSize.y = 30;
|
||||||
|
|
||||||
if (!PreCreation( parent, pos, newSize ) ||
|
if (!PreCreation( parent, pos, newSize ) ||
|
||||||
!CreateBase( parent, id, pos, size, style, validator, name ))
|
!CreateBase( parent, id, pos, size, style, validator, name ))
|
||||||
{
|
{
|
||||||
wxFAIL_MSG( wxT("wxComboBox creation failed") );
|
wxFAIL_MSG( wxT("wxComboBox creation failed") );
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
m_widget = gtk_combo_new();
|
m_widget = gtk_combo_new();
|
||||||
@@ -126,7 +128,7 @@ bool wxComboBox::Create( wxWindow *parent, wxWindowID id, const wxString& value,
|
|||||||
for (int i = 0; i < n; i++)
|
for (int i = 0; i < n; i++)
|
||||||
{
|
{
|
||||||
/* don't send first event, which GTK sends aways when
|
/* don't send first event, which GTK sends aways when
|
||||||
inserting the first item */
|
inserting the first item */
|
||||||
m_alreadySent = TRUE;
|
m_alreadySent = TRUE;
|
||||||
|
|
||||||
GtkWidget *list_item = gtk_list_item_new_with_label( choices[i].mbc_str() );
|
GtkWidget *list_item = gtk_list_item_new_with_label( choices[i].mbc_str() );
|
||||||
@@ -663,6 +665,7 @@ bool wxComboBox::IsOwnGtkWindow( GdkWindow *window )
|
|||||||
|
|
||||||
wxSize wxComboBox::DoGetBestSize() const
|
wxSize wxComboBox::DoGetBestSize() const
|
||||||
{
|
{
|
||||||
|
// totally bogus - should measure the strings in the combo!
|
||||||
return wxSize(100, 26);
|
return wxSize(100, 26);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -99,10 +99,11 @@ bool wxSpinButton::Create(wxWindow *parent,
|
|||||||
{
|
{
|
||||||
m_needParent = TRUE;
|
m_needParent = TRUE;
|
||||||
|
|
||||||
wxSize new_size = size;
|
wxSize new_size = size,
|
||||||
new_size.x = 15;
|
sizeBest = DoGetBestSize();
|
||||||
|
new_size.x = sizeBest.x; // override width always
|
||||||
if (new_size.y == -1)
|
if (new_size.y == -1)
|
||||||
new_size.y = 26;
|
new_size.y = sizeBest.y;
|
||||||
|
|
||||||
if (!PreCreation( parent, pos, new_size ) ||
|
if (!PreCreation( parent, pos, new_size ) ||
|
||||||
!CreateBase( parent, id, pos, new_size, style, wxDefaultValidator, name ))
|
!CreateBase( parent, id, pos, new_size, style, wxDefaultValidator, name ))
|
||||||
@@ -197,7 +198,7 @@ void wxSpinButton::OnSize( wxSizeEvent &WXUNUSED(event) )
|
|||||||
{
|
{
|
||||||
wxCHECK_RET( (m_widget != NULL), wxT("invalid spin button") );
|
wxCHECK_RET( (m_widget != NULL), wxT("invalid spin button") );
|
||||||
|
|
||||||
m_width = 15;
|
m_width = DoGetBestSize().x;
|
||||||
gtk_widget_set_usize( m_widget, m_width, m_height );
|
gtk_widget_set_usize( m_widget, m_width, m_height );
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -212,4 +213,9 @@ void wxSpinButton::ApplyWidgetStyle()
|
|||||||
gtk_widget_set_style( m_widget, m_widgetStyle );
|
gtk_widget_set_style( m_widget, m_widgetStyle );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
wxSize wxSpinButton::DoGetBestSize() const
|
||||||
|
{
|
||||||
|
return wxSize(15, 26);
|
||||||
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@@ -75,9 +75,12 @@ bool wxSpinCtrl::Create(wxWindow *parent, wxWindowID id,
|
|||||||
m_needParent = TRUE;
|
m_needParent = TRUE;
|
||||||
m_acceptsFocus = TRUE;
|
m_acceptsFocus = TRUE;
|
||||||
|
|
||||||
wxSize new_size = size;
|
wxSize new_size = size,
|
||||||
|
sizeBest = DoGetBestSize();
|
||||||
|
if (new_size.x == -1)
|
||||||
|
new_size.x = sizeBest.x;
|
||||||
if (new_size.y == -1)
|
if (new_size.y == -1)
|
||||||
new_size.y = 26;
|
new_size.y = sizeBest.y;
|
||||||
|
|
||||||
if (!PreCreation( parent, pos, new_size ) ||
|
if (!PreCreation( parent, pos, new_size ) ||
|
||||||
!CreateBase( parent, id, pos, new_size, style, wxDefaultValidator, name ))
|
!CreateBase( parent, id, pos, new_size, style, wxDefaultValidator, name ))
|
||||||
@@ -219,5 +222,10 @@ void wxSpinCtrl::ApplyWidgetStyle()
|
|||||||
gtk_widget_set_style( m_widget, m_widgetStyle );
|
gtk_widget_set_style( m_widget, m_widgetStyle );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
wxSize wxSpinCtrl::DoGetBestSize() const
|
||||||
|
{
|
||||||
|
return wxSize(95, 26);
|
||||||
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
// wxUSE_SPINCTRL
|
// wxUSE_SPINCTRL
|
||||||
|
@@ -1250,69 +1250,61 @@ void wxWindow::DoSetSize(int x, int y, int width, int height, int sizeFlags)
|
|||||||
GetSize(& oldW, & oldH);
|
GetSize(& oldW, & oldH);
|
||||||
GetPosition(& oldX, & oldY);
|
GetPosition(& oldX, & oldY);
|
||||||
|
|
||||||
bool useOldPos = FALSE;
|
if ( !(sizeFlags & wxSIZE_ALLOW_MINUS_ONE) )
|
||||||
bool useOldSize = FALSE;
|
{
|
||||||
|
if ( x == -1 )
|
||||||
|
x = oldX;
|
||||||
|
if ( y == -1 )
|
||||||
|
y = oldY;
|
||||||
|
}
|
||||||
|
|
||||||
if ((x == -1) && (x == -1) && ((sizeFlags & wxSIZE_ALLOW_MINUS_ONE) == 0))
|
if ( width == -1 )
|
||||||
useOldPos = TRUE;
|
width = oldW;
|
||||||
else if (x == oldX && y == oldY)
|
if ( height == -1 )
|
||||||
useOldPos = TRUE;
|
height = oldH;
|
||||||
|
|
||||||
if ((width == -1) && (height == -1))
|
bool nothingChanged = (x == oldX) && (y == oldY) &&
|
||||||
useOldSize = TRUE;
|
(width == oldW) && (height == oldH);
|
||||||
else if (width == oldW && height == oldH)
|
|
||||||
useOldSize = TRUE;
|
|
||||||
|
|
||||||
if (!wxNoOptimize::CanOptimize())
|
if (!wxNoOptimize::CanOptimize())
|
||||||
{
|
{
|
||||||
useOldSize = FALSE; useOldPos = FALSE;
|
nothingChanged = FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (useOldPos && useOldSize)
|
if ( !nothingChanged )
|
||||||
return;
|
|
||||||
|
|
||||||
if (m_drawingArea)
|
|
||||||
{
|
{
|
||||||
CanvasSetSize(x, y, width, height, sizeFlags);
|
if (m_drawingArea)
|
||||||
return;
|
{
|
||||||
}
|
CanvasSetSize(x, y, width, height, sizeFlags);
|
||||||
Widget widget = (Widget) GetTopWidget();
|
return;
|
||||||
if (!widget)
|
}
|
||||||
return;
|
|
||||||
|
|
||||||
bool managed = XtIsManaged( widget );
|
Widget widget = (Widget) GetTopWidget();
|
||||||
if (managed)
|
if (!widget)
|
||||||
XtUnmanageChild(widget);
|
return;
|
||||||
|
|
||||||
int xx = x; int yy = y;
|
bool managed = XtIsManaged( widget );
|
||||||
AdjustForParentClientOrigin(xx, yy, sizeFlags);
|
if (managed)
|
||||||
|
XtUnmanageChild(widget);
|
||||||
|
|
||||||
if (!useOldPos)
|
int xx = x;
|
||||||
{
|
int yy = y;
|
||||||
if (x > -1 || (sizeFlags & wxSIZE_ALLOW_MINUS_ONE))
|
AdjustForParentClientOrigin(xx, yy, sizeFlags);
|
||||||
XtVaSetValues(widget, XmNx, xx, NULL);
|
|
||||||
if (y > -1 || (sizeFlags & wxSIZE_ALLOW_MINUS_ONE))
|
|
||||||
XtVaSetValues(widget, XmNy, yy, NULL);
|
|
||||||
}
|
|
||||||
if (!useOldSize)
|
|
||||||
{
|
|
||||||
if (width > -1)
|
|
||||||
XtVaSetValues(widget, XmNwidth, width, NULL);
|
|
||||||
if (height > -1)
|
|
||||||
XtVaSetValues(widget, XmNheight, height, NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (managed)
|
DoMoveWindow(xx, yy, width, height);
|
||||||
XtManageChild(widget);
|
|
||||||
|
|
||||||
// How about this bit. Maybe we don't need to generate size events
|
if (managed)
|
||||||
// all the time -- they'll be generated when the window is sized anyway.
|
XtManageChild(widget);
|
||||||
|
|
||||||
|
// How about this bit. Maybe we don't need to generate size events
|
||||||
|
// all the time -- they'll be generated when the window is sized anyway.
|
||||||
#if 0
|
#if 0
|
||||||
wxSizeEvent sizeEvent(wxSize(width, height), GetId());
|
wxSizeEvent sizeEvent(wxSize(width, height), GetId());
|
||||||
sizeEvent.SetEventObject(this);
|
sizeEvent.SetEventObject(this);
|
||||||
|
|
||||||
GetEventHandler()->ProcessEvent(sizeEvent);
|
GetEventHandler()->ProcessEvent(sizeEvent);
|
||||||
#endif // 0
|
#endif // 0
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxWindow::DoSetClientSize(int width, int height)
|
void wxWindow::DoSetClientSize(int width, int height)
|
||||||
@@ -1384,6 +1376,16 @@ void wxWindow::SetSizeHints(int minW, int minH, int maxW, int maxH, int incW, in
|
|||||||
XtVaSetValues(widget, XmNheightInc, incH, NULL);
|
XtVaSetValues(widget, XmNheightInc, incH, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void wxWindow::DoMoveWindow(int x, int y, int width, int height)
|
||||||
|
{
|
||||||
|
XtVaSetValues(GetWidget(),
|
||||||
|
XmNx, xx,
|
||||||
|
XmNy, yy,
|
||||||
|
XmNwidth, width,
|
||||||
|
XmNheight, height,
|
||||||
|
NULL);
|
||||||
|
}
|
||||||
|
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
// text metrics
|
// text metrics
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
|
|
||||||
|
|
||||||
# This file was automatically generated by tmake at 02:45, 1999/12/21
|
# This file was automatically generated by tmake at 20:12, 1999/12/29
|
||||||
# DO NOT CHANGE THIS FILE, YOUR CHANGES WILL BE LOST! CHANGE B32.T!
|
# DO NOT CHANGE THIS FILE, YOUR CHANGES WILL BE LOST! CHANGE B32.T!
|
||||||
|
|
||||||
#
|
#
|
||||||
@@ -79,6 +79,7 @@ MSWDIR=.
|
|||||||
DOCDIR = $(WXDIR)\docs
|
DOCDIR = $(WXDIR)\docs
|
||||||
|
|
||||||
GENERICOBJS= $(MSWDIR)\busyinfo.obj \
|
GENERICOBJS= $(MSWDIR)\busyinfo.obj \
|
||||||
|
$(MSWDIR)\calctrl.obj \
|
||||||
$(MSWDIR)\choicdgg.obj \
|
$(MSWDIR)\choicdgg.obj \
|
||||||
$(MSWDIR)\grid.obj \
|
$(MSWDIR)\grid.obj \
|
||||||
$(MSWDIR)\laywin.obj \
|
$(MSWDIR)\laywin.obj \
|
||||||
@@ -762,6 +763,8 @@ $(MSWDIR)\zstream.obj: $(COMMDIR)\zstream.$(SRCSUFF)
|
|||||||
|
|
||||||
$(MSWDIR)\busyinfo.obj: $(GENDIR)\busyinfo.$(SRCSUFF)
|
$(MSWDIR)\busyinfo.obj: $(GENDIR)\busyinfo.$(SRCSUFF)
|
||||||
|
|
||||||
|
$(MSWDIR)\calctrl.obj: $(GENDIR)\calctrl.$(SRCSUFF)
|
||||||
|
|
||||||
$(MSWDIR)\choicdgg.obj: $(GENDIR)\choicdgg.$(SRCSUFF)
|
$(MSWDIR)\choicdgg.obj: $(GENDIR)\choicdgg.$(SRCSUFF)
|
||||||
|
|
||||||
$(MSWDIR)\grid.obj: $(GENDIR)\grid.$(SRCSUFF)
|
$(MSWDIR)\grid.obj: $(GENDIR)\grid.$(SRCSUFF)
|
||||||
@@ -912,7 +915,7 @@ $(CFG): makefile.b32
|
|||||||
-WE
|
-WE
|
||||||
-tWM
|
-tWM
|
||||||
|
|
||||||
-I$(WXINC);$(BCCDIR)\include;$(WXDIR)/src/generic;$(WXDIR)/src/png;$(WXDIR)/src/jpeg;$(WXDIR)/src/zlib;$(WXDIR)/src/xpm
|
-I$(WXINC);$(BCCDIR)\include;$(WXDIR)/src/generic;$(WXDIR)/src/png;$(WXDIR)/src/jpeg;$(WXDIR)/src/zlib;$(WXDIR)/src/xpm;$(WXDIR)/src/tiff
|
||||||
-I$(WXDIR)\include\wx\msw\gnuwin32
|
-I$(WXDIR)\include\wx\msw\gnuwin32
|
||||||
|
|
||||||
-L$(BCCDIR)\lib
|
-L$(BCCDIR)\lib
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
|
|
||||||
|
|
||||||
# This file was automatically generated by tmake at 02:45, 1999/12/21
|
# This file was automatically generated by tmake at 20:12, 1999/12/29
|
||||||
# DO NOT CHANGE THIS FILE, YOUR CHANGES WILL BE LOST! CHANGE BCC.T!
|
# DO NOT CHANGE THIS FILE, YOUR CHANGES WILL BE LOST! CHANGE BCC.T!
|
||||||
|
|
||||||
#
|
#
|
||||||
@@ -74,6 +74,7 @@ MSWDIR=.
|
|||||||
DOCDIR = $(WXDIR)\docs
|
DOCDIR = $(WXDIR)\docs
|
||||||
|
|
||||||
GENERICOBJS= $(MSWDIR)\busyinfo.obj \
|
GENERICOBJS= $(MSWDIR)\busyinfo.obj \
|
||||||
|
$(MSWDIR)\calctrl.obj \
|
||||||
$(MSWDIR)\choicdgg.obj \
|
$(MSWDIR)\choicdgg.obj \
|
||||||
$(MSWDIR)\dirdlgg.obj \
|
$(MSWDIR)\dirdlgg.obj \
|
||||||
$(MSWDIR)\grid.obj \
|
$(MSWDIR)\grid.obj \
|
||||||
@@ -616,6 +617,8 @@ ${MSWDIR}\resourc2.obj: ${COMMDIR}\resourc2.$(SRCSUFF)
|
|||||||
|
|
||||||
$(MSWDIR)\busyinfo.obj: $(GENDIR)\busyinfo.$(SRCSUFF)
|
$(MSWDIR)\busyinfo.obj: $(GENDIR)\busyinfo.$(SRCSUFF)
|
||||||
|
|
||||||
|
$(MSWDIR)\calctrl.obj: $(GENDIR)\calctrl.$(SRCSUFF)
|
||||||
|
|
||||||
$(MSWDIR)\choicdgg.obj: $(GENDIR)\choicdgg.$(SRCSUFF)
|
$(MSWDIR)\choicdgg.obj: $(GENDIR)\choicdgg.$(SRCSUFF)
|
||||||
|
|
||||||
$(MSWDIR)\dirdlgg.obj: $(GENDIR)\dirdlgg.$(SRCSUFF)
|
$(MSWDIR)\dirdlgg.obj: $(GENDIR)\dirdlgg.$(SRCSUFF)
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
# This file was automatically generated by tmake at 02:45, 1999/12/21
|
# This file was automatically generated by tmake at 20:12, 1999/12/29
|
||||||
# DO NOT CHANGE THIS FILE, YOUR CHANGES WILL BE LOST! CHANGE DOS.T!
|
# DO NOT CHANGE THIS FILE, YOUR CHANGES WILL BE LOST! CHANGE DOS.T!
|
||||||
|
|
||||||
#
|
#
|
||||||
@@ -58,6 +58,7 @@ OLEDIR=.\ole
|
|||||||
MSWDIR=.
|
MSWDIR=.
|
||||||
|
|
||||||
GENERICOBJS= $(GENDIR)\busyinfo.obj \
|
GENERICOBJS= $(GENDIR)\busyinfo.obj \
|
||||||
|
$(GENDIR)\calctrl.obj \
|
||||||
$(GENDIR)\choicdgg.obj \
|
$(GENDIR)\choicdgg.obj \
|
||||||
$(GENDIR)\dirdlgg.obj \
|
$(GENDIR)\dirdlgg.obj \
|
||||||
$(GENDIR)\grid.obj \
|
$(GENDIR)\grid.obj \
|
||||||
@@ -1109,6 +1110,11 @@ $(GENDIR)/busyinfo.obj: $*.$(SRCSUFF)
|
|||||||
$(CPPFLAGS) /Fo$@ /c /Tp $*.$(SRCSUFF)
|
$(CPPFLAGS) /Fo$@ /c /Tp $*.$(SRCSUFF)
|
||||||
<<
|
<<
|
||||||
|
|
||||||
|
$(GENDIR)/calctrl.obj: $*.$(SRCSUFF)
|
||||||
|
cl @<<
|
||||||
|
$(CPPFLAGS) /Fo$@ /c /Tp $*.$(SRCSUFF)
|
||||||
|
<<
|
||||||
|
|
||||||
$(GENDIR)/choicdgg.obj: $*.$(SRCSUFF)
|
$(GENDIR)/choicdgg.obj: $*.$(SRCSUFF)
|
||||||
cl @<<
|
cl @<<
|
||||||
$(CPPFLAGS) /Fo$@ /c /Tp $*.$(SRCSUFF)
|
$(CPPFLAGS) /Fo$@ /c /Tp $*.$(SRCSUFF)
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
# This file was automatically generated by tmake at 02:45, 1999/12/21
|
# This file was automatically generated by tmake at 20:12, 1999/12/29
|
||||||
# DO NOT CHANGE THIS FILE, YOUR CHANGES WILL BE LOST! CHANGE G95.T!
|
# DO NOT CHANGE THIS FILE, YOUR CHANGES WILL BE LOST! CHANGE G95.T!
|
||||||
|
|
||||||
#
|
#
|
||||||
@@ -53,6 +53,7 @@ endif
|
|||||||
|
|
||||||
GENERICOBJS = \
|
GENERICOBJS = \
|
||||||
$(GENDIR)/busyinfo.$(OBJSUFF) \
|
$(GENDIR)/busyinfo.$(OBJSUFF) \
|
||||||
|
$(GENDIR)/calctrl.$(OBJSUFF) \
|
||||||
$(GENDIR)/choicdgg.$(OBJSUFF) \
|
$(GENDIR)/choicdgg.$(OBJSUFF) \
|
||||||
$(GENDIR)/grid.$(OBJSUFF) \
|
$(GENDIR)/grid.$(OBJSUFF) \
|
||||||
$(GENDIR)/laywin.$(OBJSUFF) \
|
$(GENDIR)/laywin.$(OBJSUFF) \
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
|
|
||||||
|
|
||||||
# This file was automatically generated by tmake at 02:45, 1999/12/21
|
# This file was automatically generated by tmake at 20:12, 1999/12/29
|
||||||
# DO NOT CHANGE THIS FILE, YOUR CHANGES WILL BE LOST! CHANGE SC.T!
|
# DO NOT CHANGE THIS FILE, YOUR CHANGES WILL BE LOST! CHANGE SC.T!
|
||||||
|
|
||||||
# Symantec C++ makefile for the msw objects
|
# Symantec C++ makefile for the msw objects
|
||||||
@@ -27,6 +27,7 @@ OLEDIR=ole
|
|||||||
MSWDIR=$(WXDIR)\src\msw
|
MSWDIR=$(WXDIR)\src\msw
|
||||||
|
|
||||||
GENERICOBJS= $(GENDIR)\busyinfo.obj \
|
GENERICOBJS= $(GENDIR)\busyinfo.obj \
|
||||||
|
$(GENDIR)\calctrl.obj \
|
||||||
$(GENDIR)\choicdgg.obj \
|
$(GENDIR)\choicdgg.obj \
|
||||||
$(GENDIR)\grid.obj \
|
$(GENDIR)\grid.obj \
|
||||||
$(GENDIR)\laywin.obj \
|
$(GENDIR)\laywin.obj \
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
# This file was automatically generated by tmake at 02:45, 1999/12/21
|
# This file was automatically generated by tmake at 20:12, 1999/12/29
|
||||||
# DO NOT CHANGE THIS FILE, YOUR CHANGES WILL BE LOST! CHANGE VC.T!
|
# DO NOT CHANGE THIS FILE, YOUR CHANGES WILL BE LOST! CHANGE VC.T!
|
||||||
|
|
||||||
# File: makefile.vc
|
# File: makefile.vc
|
||||||
@@ -84,6 +84,7 @@ $(CPPFLAGS) /Fo$@ /c /Tp $<
|
|||||||
<<
|
<<
|
||||||
|
|
||||||
GENERICOBJS= ..\generic\$D\busyinfo.obj \
|
GENERICOBJS= ..\generic\$D\busyinfo.obj \
|
||||||
|
..\generic\$D\calctrl.obj \
|
||||||
..\generic\$D\choicdgg.obj \
|
..\generic\$D\choicdgg.obj \
|
||||||
..\generic\$D\grid.obj \
|
..\generic\$D\grid.obj \
|
||||||
..\generic\$D\laywin.obj \
|
..\generic\$D\laywin.obj \
|
||||||
@@ -572,31 +573,20 @@ cleanall: clean
|
|||||||
# Making documents
|
# Making documents
|
||||||
docs: allhlp allhtml allpdfrtf
|
docs: allhlp allhtml allpdfrtf
|
||||||
alldocs: docs
|
alldocs: docs
|
||||||
hlp: wxhlp portinghlp
|
hlp: wxhlp
|
||||||
wxhlp: $(DOCDIR)/winhelp/wx.hlp
|
wxhlp: $(DOCDIR)/winhelp/wx.hlp
|
||||||
prophlp: $(DOCDIR)/winhelp/prop.hlp
|
|
||||||
refhlp: $(DOCDIR)/winhelp/techref.hlp
|
refhlp: $(DOCDIR)/winhelp/techref.hlp
|
||||||
rtf: $(DOCDIR)/winhelp/wx.rtf
|
rtf: $(DOCDIR)/winhelp/wx.rtf
|
||||||
proprtf: $(DOCDIR)/winhelp/prop.rtf
|
|
||||||
pdfrtf: $(DOCDIR)/pdf/wx.rtf
|
pdfrtf: $(DOCDIR)/pdf/wx.rtf
|
||||||
proppdfrtf: $(DOCDIR)/pdf/prop.rtf
|
|
||||||
refpdfrtf: $(DOCDIR)/pdf/techref.rtf
|
refpdfrtf: $(DOCDIR)/pdf/techref.rtf
|
||||||
html: wxhtml portinghtml
|
html: wxhtml
|
||||||
wxhtml: $(DOCDIR)\html\wx\wx.htm
|
wxhtml: $(DOCDIR)\html\wx\wx.htm
|
||||||
htmlhelp: $(DOCDIR)\html\wx\wx.chm
|
htmlhelp: $(DOCDIR)\html\wx\wx.chm
|
||||||
prophtml: $(DOCDIR)\html\proplist\prop.htm
|
|
||||||
ps: wxps referencps
|
ps: wxps referencps
|
||||||
wxps: $(WXDIR)\docs\ps\wx.ps
|
wxps: $(WXDIR)\docs\ps\wx.ps
|
||||||
propps: $(WXDIR)\docs\ps\prop.ps
|
|
||||||
referencps: $(WXDIR)\docs\ps\referenc.ps
|
referencps: $(WXDIR)\docs\ps\referenc.ps
|
||||||
|
|
||||||
portinghtml: $(DOCDIR)\html\porting\port.htm
|
allhlp: wxhlp
|
||||||
portingrtf: $(DOCDIR)/winhelp/porting.rtf
|
|
||||||
portinghlp: $(DOCDIR)/winhelp/porting.hlp
|
|
||||||
portingpdfrtf: $(DOCDIR)/pdf/porting.rtf
|
|
||||||
portingps: $(WXDIR)\docs\ps\porting.ps
|
|
||||||
|
|
||||||
allhlp: wxhlp portinghlp prophlp
|
|
||||||
cd $(WXDIR)\utils\dialoged\src
|
cd $(WXDIR)\utils\dialoged\src
|
||||||
nmake -f makefile.vc hlp
|
nmake -f makefile.vc hlp
|
||||||
cd $(THISDIR)
|
cd $(THISDIR)
|
||||||
@@ -616,7 +606,7 @@ allhlp: wxhlp portinghlp prophlp
|
|||||||
# cd $(WXDIR)\utils\wxgrid\src
|
# cd $(WXDIR)\utils\wxgrid\src
|
||||||
# nmake -f makefile.vc hlp
|
# nmake -f makefile.vc hlp
|
||||||
|
|
||||||
allhtml: wxhtml portinghtml prophtml
|
allhtml: wxhtml
|
||||||
cd $(WXDIR)\utils\dialoged\src
|
cd $(WXDIR)\utils\dialoged\src
|
||||||
nmake -f makefile.vc html
|
nmake -f makefile.vc html
|
||||||
cd $(THISDIR)
|
cd $(THISDIR)
|
||||||
@@ -637,12 +627,12 @@ allhtml: wxhtml portinghtml prophtml
|
|||||||
# cd $(WXDIR)\utils\wxtree\src
|
# cd $(WXDIR)\utils\wxtree\src
|
||||||
# nmake -f makefile.vc html
|
# nmake -f makefile.vc html
|
||||||
|
|
||||||
allps: wxps referencps portingps propps
|
allps: wxps referencps
|
||||||
cd $(WXDIR)\utils\dialoged\src
|
cd $(WXDIR)\utils\dialoged\src
|
||||||
nmake -f makefile.vc ps
|
nmake -f makefile.vc ps
|
||||||
cd $(THISDIR)
|
cd $(THISDIR)
|
||||||
|
|
||||||
allpdfrtf: pdfrtf portingpdfrtf proppdfrtf
|
allpdfrtf: pdfrtf
|
||||||
cd $(WXDIR)\utils\dialoged\src
|
cd $(WXDIR)\utils\dialoged\src
|
||||||
nmake -f makefile.vc pdfrtf
|
nmake -f makefile.vc pdfrtf
|
||||||
cd $(THISDIR)
|
cd $(THISDIR)
|
||||||
@@ -667,22 +657,6 @@ $(DOCDIR)/winhelp/wx.hlp: $(DOCDIR)/latex/wx/wx.rtf $(DOCDIR)/latex/wx/w
|
|||||||
move wx.cnt $(DOCDIR)\winhelp\wx.cnt
|
move wx.cnt $(DOCDIR)\winhelp\wx.cnt
|
||||||
cd $(THISDIR)
|
cd $(THISDIR)
|
||||||
|
|
||||||
$(DOCDIR)/winhelp/porting.hlp: $(DOCDIR)/latex/porting/porting.rtf $(DOCDIR)/latex/porting/porting.hpj
|
|
||||||
cd $(DOCDIR)/latex/porting
|
|
||||||
-erase porting.ph
|
|
||||||
hc porting
|
|
||||||
move porting.hlp $(DOCDIR)\winhelp\porting.hlp
|
|
||||||
move porting.cnt $(DOCDIR)\winhelp\porting.cnt
|
|
||||||
cd $(THISDIR)
|
|
||||||
|
|
||||||
$(DOCDIR)/winhelp/prop.hlp: $(DOCDIR)/latex/proplist/prop.rtf $(DOCDIR)/latex/proplist/prop.hpj
|
|
||||||
cd $(DOCDIR)/latex/proplist
|
|
||||||
-erase prop.ph
|
|
||||||
hc prop
|
|
||||||
move prop.hlp $(DOCDIR)\winhelp\prop.hlp
|
|
||||||
move prop.cnt $(DOCDIR)\winhelp\prop.cnt
|
|
||||||
cd $(THISDIR)
|
|
||||||
|
|
||||||
$(DOCDIR)/winhelp/techref.hlp: $(DOCDIR)/latex/techref/techref.rtf $(DOCDIR)/latex/techref/techref.hpj
|
$(DOCDIR)/winhelp/techref.hlp: $(DOCDIR)/latex/techref/techref.rtf $(DOCDIR)/latex/techref/techref.hpj
|
||||||
cd $(DOCDIR)/latex/techref
|
cd $(DOCDIR)/latex/techref
|
||||||
-erase techref.ph
|
-erase techref.ph
|
||||||
@@ -696,16 +670,6 @@ $(DOCDIR)/latex/wx/wx.rtf: $(DOCDIR)/latex/wx/classes.tex $(DOCDIR)/late
|
|||||||
-start $(WAITFLAG) tex2rtf $(DOCDIR)/latex/wx/manual.tex $(DOCDIR)/latex/wx/wx.rtf -twice -winhelp
|
-start $(WAITFLAG) tex2rtf $(DOCDIR)/latex/wx/manual.tex $(DOCDIR)/latex/wx/wx.rtf -twice -winhelp
|
||||||
cd $(THISDIR)
|
cd $(THISDIR)
|
||||||
|
|
||||||
$(DOCDIR)/latex/porting/porting.rtf: $(DOCDIR)/latex/porting/porting.tex
|
|
||||||
cd $(DOCDIR)\latex\porting
|
|
||||||
-start $(WAITFLAG) tex2rtf $(DOCDIR)/latex/porting/porting.tex $(DOCDIR)/latex/porting/porting.rtf -twice -winhelp
|
|
||||||
cd $(THISDIR)
|
|
||||||
|
|
||||||
$(DOCDIR)/latex/proplist/prop.rtf: $(DOCDIR)/latex/proplist/prop.tex $(DOCDIR)/latex/proplist/body.tex $(DOCDIR)/latex/proplist/classes.tex $(DOCDIR)/latex/proplist/changes.tex
|
|
||||||
cd $(DOCDIR)\latex\proplist
|
|
||||||
-start $(WAITFLAG) tex2rtf $(DOCDIR)/latex/proplist/prop.tex $(DOCDIR)/latex/proplist/prop.rtf -twice -winhelp
|
|
||||||
cd $(THISDIR)
|
|
||||||
|
|
||||||
$(DOCDIR)/latex/techref/techref.rtf: $(DOCDIR)/latex/techref/techref.tex
|
$(DOCDIR)/latex/techref/techref.rtf: $(DOCDIR)/latex/techref/techref.tex
|
||||||
cd $(DOCDIR)\latex\techref
|
cd $(DOCDIR)\latex\techref
|
||||||
-start $(WAITFLAG) tex2rtf $(DOCDIR)/latex/techref/techref.tex $(DOCDIR)/latex/techref/techref.rtf -twice -winhelp
|
-start $(WAITFLAG) tex2rtf $(DOCDIR)/latex/techref/techref.tex $(DOCDIR)/latex/techref/techref.rtf -twice -winhelp
|
||||||
@@ -718,20 +682,6 @@ $(DOCDIR)/pdf/wx.rtf: $(DOCDIR)/latex/wx/classes.tex $(DOCDIR)/latex/wx/
|
|||||||
-start $(WAITFLAG) tex2rtf $(DOCDIR)/latex/wx/manual.tex $(DOCDIR)/pdf/wx.rtf -twice -rtf
|
-start $(WAITFLAG) tex2rtf $(DOCDIR)/latex/wx/manual.tex $(DOCDIR)/pdf/wx.rtf -twice -rtf
|
||||||
cd $(THISDIR)
|
cd $(THISDIR)
|
||||||
|
|
||||||
$(DOCDIR)/pdf/porting.rtf: $(DOCDIR)/latex/porting/porting.tex
|
|
||||||
cd $(DOCDIR)\latex\porting
|
|
||||||
-copy *.wmf $(DOCDIR)\pdf
|
|
||||||
-copy *.bmp $(DOCDIR)\pdf
|
|
||||||
-start $(WAITFLAG) tex2rtf $(DOCDIR)/latex/porting/porting.tex $(DOCDIR)/pdf/porting.rtf -twice -rtf
|
|
||||||
cd $(THISDIR)
|
|
||||||
|
|
||||||
$(DOCDIR)/pdf/prop.rtf: $(DOCDIR)/latex/proplist/prop.tex $(DOCDIR)/latex/proplist/body.tex $(DOCDIR)/latex/proplist/classes.tex $(DOCDIR)/latex/proplist/changes.tex
|
|
||||||
cd $(DOCDIR)\latex\proplist
|
|
||||||
-copy *.wmf $(DOCDIR)\pdf
|
|
||||||
-copy *.bmp $(DOCDIR)\pdf
|
|
||||||
-start $(WAITFLAG) tex2rtf $(DOCDIR)/latex/proplist/prop.tex $(DOCDIR)/pdf/prop.rtf -twice -rtf
|
|
||||||
cd $(THISDIR)
|
|
||||||
|
|
||||||
$(DOCDIR)/pdf/techref.rtf: $(DOCDIR)/latex/techref/techref.tex
|
$(DOCDIR)/pdf/techref.rtf: $(DOCDIR)/latex/techref/techref.tex
|
||||||
cd $(DOCDIR)\latex\techref
|
cd $(DOCDIR)\latex\techref
|
||||||
-copy *.wmf $(DOCDIR)\pdf
|
-copy *.wmf $(DOCDIR)\pdf
|
||||||
@@ -754,27 +704,6 @@ $(DOCDIR)\html\wx\wx.chm : $(DOCDIR)\html\wx\wx.htm $(DOCDIR)\html\wx\wx.hhp
|
|||||||
-hhc wx.hhp
|
-hhc wx.hhp
|
||||||
cd $(THISDIR)
|
cd $(THISDIR)
|
||||||
|
|
||||||
|
|
||||||
$(DOCDIR)\html\porting\port.htm: $(DOCDIR)\latex\porting\porting.tex
|
|
||||||
cd $(DOCDIR)\latex\porting
|
|
||||||
-mkdir $(DOCDIR)\html\porting
|
|
||||||
-start $(WAITFLAG) tex2rtf $(DOCDIR)\latex\porting\porting.tex $(DOCDIR)\html\porting\port.htm -twice -html
|
|
||||||
-erase $(DOCDIR)\html\porting\*.con
|
|
||||||
-erase $(DOCDIR)\html\porting\*.ref
|
|
||||||
-erase $(DOCDIR)\latex\porting\*.con
|
|
||||||
-erase $(DOCDIR)\latex\porting\*.ref
|
|
||||||
cd $(THISDIR)
|
|
||||||
|
|
||||||
$(DOCDIR)\html\proplist\prop.htm: $(DOCDIR)\latex\proplist\prop.tex $(DOCDIR)\latex\proplist\body.tex $(DOCDIR)\latex\proplist\classes.tex $(DOCDIR)\latex\proplist\changes.tex
|
|
||||||
cd $(DOCDIR)\latex\proplist
|
|
||||||
-mkdir $(DOCDIR)\html\proplist
|
|
||||||
-start $(WAITFLAG) tex2rtf $(DOCDIR)\latex\proplist\prop.tex $(DOCDIR)\html\proplist\prop.htm -twice -html
|
|
||||||
-erase $(DOCDIR)\html\proplist\*.con
|
|
||||||
-erase $(DOCDIR)\html\proplist\*.ref
|
|
||||||
-erase $(DOCDIR)\latex\proplist\*.con
|
|
||||||
-erase $(DOCDIR)\latex\proplist\*.ref
|
|
||||||
cd $(THISDIR)
|
|
||||||
|
|
||||||
$(WXDIR)\docs\latex\wx\manual.dvi: $(DOCDIR)/latex/wx/body.tex $(DOCDIR)/latex/wx/manual.tex
|
$(WXDIR)\docs\latex\wx\manual.dvi: $(DOCDIR)/latex/wx/body.tex $(DOCDIR)/latex/wx/manual.tex
|
||||||
cd $(WXDIR)\docs\latex\wx
|
cd $(WXDIR)\docs\latex\wx
|
||||||
-latex manual
|
-latex manual
|
||||||
@@ -785,28 +714,12 @@ $(WXDIR)\docs\latex\wx\manual.dvi: $(DOCDIR)/latex/wx/body.tex $(DOCDIR)/latex/w
|
|||||||
-latex manual
|
-latex manual
|
||||||
cd $(THISDIR)
|
cd $(THISDIR)
|
||||||
|
|
||||||
$(WXDIR)\docs\latex\porting\porting.dvi: $(DOCDIR)/latex/porting/porting.tex
|
|
||||||
cd $(WXDIR)\docs\latex\porting
|
|
||||||
-latex porting
|
|
||||||
-latex porting
|
|
||||||
-makeindx porting
|
|
||||||
-bibtex porting
|
|
||||||
-latex porting
|
|
||||||
-latex porting
|
|
||||||
cd $(THISDIR)
|
|
||||||
|
|
||||||
$(WXDIR)\docs\ps\wx.ps: $(WXDIR)\docs\latex\wx\manual.dvi
|
$(WXDIR)\docs\ps\wx.ps: $(WXDIR)\docs\latex\wx\manual.dvi
|
||||||
cd $(WXDIR)\docs\latex\wx
|
cd $(WXDIR)\docs\latex\wx
|
||||||
-dvips32 -o wx.ps manual
|
-dvips32 -o wx.ps manual
|
||||||
move wx.ps $(WXDIR)\docs\ps\wx.ps
|
move wx.ps $(WXDIR)\docs\ps\wx.ps
|
||||||
cd $(THISDIR)
|
cd $(THISDIR)
|
||||||
|
|
||||||
$(WXDIR)\docs\ps\porting.ps: $(WXDIR)\docs\latex\porting\porting.dvi
|
|
||||||
cd $(WXDIR)\docs\latex\porting
|
|
||||||
-dvips32 -o porting.ps porting
|
|
||||||
move porting.ps $(WXDIR)\docs\ps\porting.ps
|
|
||||||
cd $(THISDIR)
|
|
||||||
|
|
||||||
$(WXDIR)\docs\latex\wx\referenc.dvi: $(DOCDIR)/latex/wx/classes.tex $(DOCDIR)/latex/wx/topics.tex $(DOCDIR)/latex/wx/referenc.tex
|
$(WXDIR)\docs\latex\wx\referenc.dvi: $(DOCDIR)/latex/wx/classes.tex $(DOCDIR)/latex/wx/topics.tex $(DOCDIR)/latex/wx/referenc.tex
|
||||||
cd $(WXDIR)\docs\latex\wx
|
cd $(WXDIR)\docs\latex\wx
|
||||||
-latex referenc
|
-latex referenc
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
#!/binb/wmake.exe
|
#!/binb/wmake.exe
|
||||||
|
|
||||||
# This file was automatically generated by tmake at 02:45, 1999/12/21
|
# This file was automatically generated by tmake at 20:12, 1999/12/29
|
||||||
# DO NOT CHANGE THIS FILE, YOUR CHANGES WILL BE LOST! CHANGE WAT.T!
|
# DO NOT CHANGE THIS FILE, YOUR CHANGES WILL BE LOST! CHANGE WAT.T!
|
||||||
|
|
||||||
#
|
#
|
||||||
@@ -40,6 +40,7 @@ OLEDIR=$(MSWDIR)\ole
|
|||||||
DOCDIR = $(WXDIR)\docs
|
DOCDIR = $(WXDIR)\docs
|
||||||
|
|
||||||
GENERICOBJS= busyinfo.obj &
|
GENERICOBJS= busyinfo.obj &
|
||||||
|
calctrl.obj &
|
||||||
choicdgg.obj &
|
choicdgg.obj &
|
||||||
grid.obj &
|
grid.obj &
|
||||||
laywin.obj &
|
laywin.obj &
|
||||||
@@ -907,6 +908,9 @@ $(COMMDIR)\lex_yy.c: $(COMMDIR)\doslex.c
|
|||||||
busyinfo.obj: $(GENDIR)\busyinfo.cpp
|
busyinfo.obj: $(GENDIR)\busyinfo.cpp
|
||||||
*$(CCC) $(CPPFLAGS) $(IFLAGS) $<
|
*$(CCC) $(CPPFLAGS) $(IFLAGS) $<
|
||||||
|
|
||||||
|
calctrl.obj: $(GENDIR)\calctrl.cpp
|
||||||
|
*$(CCC) $(CPPFLAGS) $(IFLAGS) $<
|
||||||
|
|
||||||
choicdgg.obj: $(GENDIR)\choicdgg.cpp
|
choicdgg.obj: $(GENDIR)\choicdgg.cpp
|
||||||
*$(CCC) $(CPPFLAGS) $(IFLAGS) $<
|
*$(CCC) $(CPPFLAGS) $(IFLAGS) $<
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user