Merges from Scitech Branch (George Davison):

Added wxDisplayChangedEvent and triggering in MSW, when display mode changes
this event gets triggered. I don't know what should happen with other OS's
since I am not familiar with how they handle mode changes.

Watcome Version 11 now compiles with wide character support.

Fixed watcom warnings in
	html/htmlwin.h
	imagbmp.h
	listctrl.h
	imagbmp.cpp
	quantize.cpp
	strconv.cpp
	variant.cpp
	dirctrlg.cpp
	treectlg.cpp
	m_style.cpp
	fontenum.cpp
	listctrl.cpp
	ole\dataobj.cpp
	textctrl.cpp
	window.cpp
	xml.cpp

msw/setup.h
	with watcom version 11 it now compiles with wide character support.

xrc/xml.cpp
	fixed memory leak and compile warnings


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@14057 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Kendall Bennett
2002-02-07 18:46:31 +00:00
parent 952ae1e88b
commit 574c939ef1
46 changed files with 1131 additions and 633 deletions

View File

@@ -28,7 +28,6 @@
#include "wx/brush.h"
#include "wx/pen.h"
#include "wx/palette.h"
#include "wx/list.h" // we use wxList in inline functions
class WXDLLEXPORT wxDCBase;
@@ -741,6 +740,7 @@ protected:
#if wxUSE_PALETTE
wxPalette m_palette;
bool m_custompalette;
#endif // wxUSE_PALETTE
private:

View File

@@ -230,20 +230,21 @@ BEGIN_DECLARE_EVENT_TYPES()
DECLARE_EVENT_TYPE(wxEVT_POPUP_MENU_INIT, 423)
DECLARE_EVENT_TYPE(wxEVT_CONTEXT_MENU, 424)
DECLARE_EVENT_TYPE(wxEVT_SYS_COLOUR_CHANGED, 425)
DECLARE_EVENT_TYPE(wxEVT_SETTING_CHANGED, 426)
DECLARE_EVENT_TYPE(wxEVT_QUERY_NEW_PALETTE, 427)
DECLARE_EVENT_TYPE(wxEVT_PALETTE_CHANGED, 428)
DECLARE_EVENT_TYPE(wxEVT_JOY_BUTTON_DOWN, 429)
DECLARE_EVENT_TYPE(wxEVT_JOY_BUTTON_UP, 430)
DECLARE_EVENT_TYPE(wxEVT_JOY_MOVE, 431)
DECLARE_EVENT_TYPE(wxEVT_JOY_ZMOVE, 432)
DECLARE_EVENT_TYPE(wxEVT_DROP_FILES, 433)
DECLARE_EVENT_TYPE(wxEVT_DRAW_ITEM, 434)
DECLARE_EVENT_TYPE(wxEVT_MEASURE_ITEM, 435)
DECLARE_EVENT_TYPE(wxEVT_COMPARE_ITEM, 436)
DECLARE_EVENT_TYPE(wxEVT_INIT_DIALOG, 437)
DECLARE_EVENT_TYPE(wxEVT_IDLE, 438)
DECLARE_EVENT_TYPE(wxEVT_UPDATE_UI, 439)
DECLARE_EVENT_TYPE(wxEVT_DISPLAY_CHANGED, 426)
DECLARE_EVENT_TYPE(wxEVT_SETTING_CHANGED, 427)
DECLARE_EVENT_TYPE(wxEVT_QUERY_NEW_PALETTE, 428)
DECLARE_EVENT_TYPE(wxEVT_PALETTE_CHANGED, 429)
DECLARE_EVENT_TYPE(wxEVT_JOY_BUTTON_DOWN, 430)
DECLARE_EVENT_TYPE(wxEVT_JOY_BUTTON_UP, 431)
DECLARE_EVENT_TYPE(wxEVT_JOY_MOVE, 432)
DECLARE_EVENT_TYPE(wxEVT_JOY_ZMOVE, 433)
DECLARE_EVENT_TYPE(wxEVT_DROP_FILES, 434)
DECLARE_EVENT_TYPE(wxEVT_DRAW_ITEM, 435)
DECLARE_EVENT_TYPE(wxEVT_MEASURE_ITEM, 436)
DECLARE_EVENT_TYPE(wxEVT_COMPARE_ITEM, 437)
DECLARE_EVENT_TYPE(wxEVT_INIT_DIALOG, 438)
DECLARE_EVENT_TYPE(wxEVT_IDLE, 439)
DECLARE_EVENT_TYPE(wxEVT_UPDATE_UI, 440)
// Generic command events
// Note: a click is a higher-level event than button down/up
@@ -1380,6 +1381,21 @@ private:
DECLARE_DYNAMIC_CLASS(wxSysColourChangedEvent)
};
/*
wxEVT_DISPLAY_CHANGED
*/
class WXDLLEXPORT wxDisplayChangedEvent : public wxEvent
{
private:
DECLARE_DYNAMIC_CLASS(wxDisplayChangedEvent)
public:
wxDisplayChangedEvent()
{ m_eventType = wxEVT_DISPLAY_CHANGED; }
virtual wxEvent *Clone() const { return new wxDisplayChangedEvent(*this); }
};
/*
wxEVT_PALETTE_CHANGED
*/
@@ -1899,6 +1915,7 @@ typedef void (wxEvtHandler::*wxJoystickEventFunction)(wxJoystickEvent&);
typedef void (wxEvtHandler::*wxDropFilesEventFunction)(wxDropFilesEvent&);
typedef void (wxEvtHandler::*wxInitDialogEventFunction)(wxInitDialogEvent&);
typedef void (wxEvtHandler::*wxSysColourChangedFunction)(wxSysColourChangedEvent&);
typedef void (wxEvtHandler::*wxDisplayChangedFunction)(wxDisplayChangedEvent&);
typedef void (wxEvtHandler::*wxUpdateUIEventFunction)(wxUpdateUIEvent&);
typedef void (wxEvtHandler::*wxIdleEventFunction)(wxIdleEvent&);
typedef void (wxEvtHandler::*wxCloseEventFunction)(wxCloseEvent&);
@@ -1968,6 +1985,7 @@ typedef void (wxEvtHandler::*wxContextMenuEventFunction)(wxContextMenuEvent&);
#define EVT_DROP_FILES(func) DECLARE_EVENT_TABLE_ENTRY( wxEVT_DROP_FILES, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxDropFilesEventFunction) & func, (wxObject *) NULL ),
#define EVT_INIT_DIALOG(func) DECLARE_EVENT_TABLE_ENTRY( wxEVT_INIT_DIALOG, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxInitDialogEventFunction) & func, (wxObject *) NULL ),
#define EVT_SYS_COLOUR_CHANGED(func) DECLARE_EVENT_TABLE_ENTRY( wxEVT_SYS_COLOUR_CHANGED, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxSysColourChangedFunction) & func, (wxObject *) NULL ),
#define EVT_DISPLAY_CHANGED(func) DECLARE_EVENT_TABLE_ENTRY( wxEVT_DISPLAY_CHANGED, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxDisplayChangedFunction) & func, (wxObject *) NULL ),
#define EVT_SHOW(func) DECLARE_EVENT_TABLE_ENTRY( wxEVT_SHOW, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxShowEventFunction) & func, (wxObject *) NULL ),
#define EVT_MAXIMIZE(func) DECLARE_EVENT_TABLE_ENTRY( wxEVT_MAXIMIZE, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxMaximizeEventFunction) & func, (wxObject *) NULL ),
#define EVT_ICONIZE(func) DECLARE_EVENT_TABLE_ENTRY( wxEVT_ICONIZE, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxIconizeEventFunction) & func, (wxObject *) NULL ),

View File

@@ -85,7 +85,7 @@ public:
// specify document location, use LoadPage() istead
// Return value : FALSE if an error occured, TRUE otherwise
bool SetPage(const wxString& source);
// Append to current page
bool AppendToPage(const wxString& source);
@@ -175,14 +175,14 @@ public:
// Called when user clicked on hypertext link. Default behavior is to
// call LoadPage(loc)
virtual void OnLinkClicked(const wxHtmlLinkInfo& link);
// Called when wxHtmlWindow wants to fetch data from an URL (e.g. when
// loading a page or loading an image). The data are downloaded if and only if
// Called when wxHtmlWindow wants to fetch data from an URL (e.g. when
// loading a page or loading an image). The data are downloaded if and only if
// OnOpeningURL returns TRUE. If OnOpeningURL returns wxHTML_REDIRECT,
// it must set *redirect to the new URL
virtual wxHtmlOpeningStatus OnOpeningURL(wxHtmlURLType type,
const wxString& url,
wxString *redirect) const
virtual wxHtmlOpeningStatus OnOpeningURL(wxHtmlURLType WXUNUSED(type),
const wxString& WXUNUSED(url),
wxString *WXUNUSED(redirect)) const
{ return wxHTML_OPEN; }
protected:

View File

@@ -53,11 +53,11 @@ public:
virtual bool SaveFile( wxImage *image, wxOutputStream& stream, bool verbose=TRUE );
virtual bool LoadFile( wxImage *image, wxInputStream& stream, bool verbose=TRUE, int index=-1 );
virtual bool DoCanRead( wxInputStream& stream );
protected:
bool SaveDib(wxImage *image, wxOutputStream& stream, bool verbose,
bool SaveDib(wxImage *image, wxOutputStream& stream, bool verbose,
bool IsBmp, bool IsMask);
bool DoLoadDib(wxImage *image, int width, int height, int bpp, int ncolors,
bool DoLoadDib(wxImage *image, int width, int height, int bpp, int ncolors,
int comp, off_t bmpOffset, wxInputStream& stream,
bool verbose, bool IsBmp, bool hasPalette);
bool LoadDib(wxImage *image, wxInputStream& stream, bool verbose, bool IsBmp);
@@ -115,7 +115,7 @@ public:
m_type = wxBITMAP_TYPE_CUR;
m_mime = _T("image/x-cur");
};
// VS: This handler's meat is implemented inside wxICOHandler (the two
// formats are almost identical), but we hide this fact at
// the API level, since it is a mere implementation detail.
@@ -141,10 +141,10 @@ public:
m_type = wxBITMAP_TYPE_ANI;
m_mime = _T("image/x-ani");
};
#if wxUSE_STREAMS
virtual bool SaveFile( wxImage *image, wxOutputStream& stream, bool verbose=TRUE ) {return FALSE ;};
virtual bool SaveFile( wxImage *WXUNUSED(image), wxOutputStream& WXUNUSED(stream), bool WXUNUSED(verbose=TRUE) ){return FALSE ;};
virtual bool LoadFile( wxImage *image, wxInputStream& stream, bool verbose=TRUE, int index=-1 );
virtual bool DoCanRead( wxInputStream& stream );
virtual int GetImageCount( wxInputStream& stream );

View File

@@ -300,7 +300,7 @@ public:
const wxValidator& validator = wxDefaultValidator,
const wxString &name = "listctrl" )
{
Create(parent, id, pos, size, style, wxDefaultValidator, name);
Create(parent, id, pos, size, style, validator, name);
}
// focus/selection stuff

View File

@@ -102,7 +102,13 @@ public:
virtual void SelectOldObjects(WXHDC dc);
wxWindow *GetWindow() const { return m_canvas; }
void SetWindow(wxWindow *win) { m_canvas = win; }
void SetWindow(wxWindow *win) {
m_canvas = win;
#if wxUSE_PALETTE
// if we have palettes use the correct one for this window
InitializePalette();
#endif
}
WXHDC GetHDC() const { return m_hDC; }
void SetHDC(WXHDC dc, bool bOwnsDC = FALSE)
@@ -184,6 +190,15 @@ protected:
int fillStyle = wxODDEVEN_RULE);
#if wxUSE_PALETTE
// MSW specific, select a logical palette into the HDC
// (tell windows to translate pixel from other palettes to our custom one
// and vice versa)
// Realize tells it to also reset the system palette to this one.
void DoSelectPalette(bool realize = false);
// Find out what palette our parent window has, then select it into the dc
void InitializePalette();
#endif
// common part of DoDrawText() and DoDrawRotatedText()
void DrawAnyText(const wxString& text, wxCoord x, wxCoord y);

View File

@@ -331,6 +331,8 @@ public:
bool HandlePaletteChanged(WXHWND hWndPalChange);
bool HandleQueryNewPalette();
bool HandleSysColorChange();
bool HandleDisplayChange();
bool HandleQueryEndSession(long logOff, bool *mayEnd);
bool HandleEndSession(bool endSession, long logOff);

View File

@@ -32,6 +32,11 @@
#include "wx/validate.h" // for wxDefaultValidator (always include it)
#if wxUSE_PALETTE
#include "wx/dcclient.h"
#include "wx/palette.h"
#endif // wxUSE_PALETTE
#if wxUSE_ACCEL
#include "wx/accel.h"
#endif // wxUSE_ACCEL
@@ -761,6 +766,21 @@ public:
// platform-specific APIs
virtual WXWidget GetHandle() const = 0;
#if wxUSE_PALETTE
// Store the palette used by DCs in wxWindow so that the dcs can share
// a palette. And we can respond to palette messages.
wxPalette GetPalette() const { return m_palette; }
// When palette is changed tell the DC to set the system palette to the
// new one.
void SetPalette(wxPalette &pal) {
m_custompalette=true;
m_palette=pal;
wxWindowDC d((wxWindow *) this);
d.SetPalette(pal);
}
bool HasCustomPalette() { return m_custompalette; }
#endif // wxUSE_PALETTE
protected:
// the window id - a number which uniquely identifies a window among
// its siblings unless it is -1
@@ -844,6 +864,11 @@ protected:
wxString m_windowName;
bool m_themeEnabled;
#ifdef wxUSE_PALETTE
wxPalette m_palette;
bool m_custompalette;
#endif
protected:
// common part of all ctors: it is not virtual because it is called from