wxOS2/OW warning and build fixes.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@35282 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -28,7 +28,7 @@
|
|||||||
#include "wx/wx.h"
|
#include "wx/wx.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(__WXGTK__) || defined(__WXX11__) || defined(__WXMOTIF__) || defined(__WXMAC__)
|
#ifndef __WXMSW__
|
||||||
#include "mondrian.xpm"
|
#include "mondrian.xpm"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -45,9 +45,11 @@ IMPLEMENT_APP(MyApp)
|
|||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
|
|
||||||
BEGIN_EVENT_TABLE(MyFrame, wxFrame)
|
BEGIN_EVENT_TABLE(MyFrame, wxFrame)
|
||||||
EVT_MENU(ANITEST_ABOUT, MyFrame::OnAbout)
|
EVT_MENU(wxID_ABOUT, MyFrame::OnAbout)
|
||||||
EVT_MENU(ANITEST_QUIT, MyFrame::OnQuit)
|
EVT_MENU(wxID_EXIT, MyFrame::OnQuit)
|
||||||
EVT_MENU(ANITEST_OPEN, MyFrame::OnOpen)
|
#if wxUSE_FILEDLG
|
||||||
|
EVT_MENU(wxID_OPEN, MyFrame::OnOpen)
|
||||||
|
#endif // wxUSE_FILEDLG
|
||||||
|
|
||||||
EVT_SIZE(MyFrame::OnSize)
|
EVT_SIZE(MyFrame::OnSize)
|
||||||
END_EVENT_TABLE()
|
END_EVENT_TABLE()
|
||||||
@@ -79,11 +81,13 @@ bool MyApp::OnInit()
|
|||||||
// Make a menubar
|
// Make a menubar
|
||||||
wxMenu *file_menu = new wxMenu;
|
wxMenu *file_menu = new wxMenu;
|
||||||
|
|
||||||
file_menu->Append(ANITEST_OPEN, _T("&Open Animation...\tCtrl+O"), _T("Open a GIF animation"));
|
#if wxUSE_FILEDLG
|
||||||
file_menu->Append(ANITEST_QUIT, _T("&Exit\tAlt+X"), _T("Quit the program"));
|
file_menu->Append(wxID_OPEN, _T("&Open Animation...\tCtrl+O"), _T("Open a GIF animation"));
|
||||||
|
#endif // wxUSE_FILEDLG
|
||||||
|
file_menu->Append(wxID_EXIT, _T("&Exit\tAlt+X"), _T("Quit the program"));
|
||||||
|
|
||||||
wxMenu *help_menu = new wxMenu;
|
wxMenu *help_menu = new wxMenu;
|
||||||
help_menu->Append(ANITEST_ABOUT, _T("&About\tF1"));
|
help_menu->Append(wxID_ABOUT, _T("&About\tF1"));
|
||||||
|
|
||||||
wxMenuBar *menu_bar = new wxMenuBar;
|
wxMenuBar *menu_bar = new wxMenuBar;
|
||||||
|
|
||||||
@@ -97,11 +101,11 @@ bool MyApp::OnInit()
|
|||||||
frame->CreateStatusBar();
|
frame->CreateStatusBar();
|
||||||
#endif // wxUSE_STATUSBAR
|
#endif // wxUSE_STATUSBAR
|
||||||
|
|
||||||
frame->Show(TRUE);
|
frame->Show(true);
|
||||||
|
|
||||||
SetTopWindow(frame);
|
SetTopWindow(frame);
|
||||||
|
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
@@ -119,9 +123,9 @@ MyFrame::MyFrame(wxWindow *parent,
|
|||||||
style | wxNO_FULL_REPAINT_ON_RESIZE)
|
style | wxNO_FULL_REPAINT_ON_RESIZE)
|
||||||
{
|
{
|
||||||
// m_animation = NULL;
|
// m_animation = NULL;
|
||||||
m_canvas = new MyCanvas(this, wxPoint(0, 0), wxSize(-1, -1));
|
m_canvas = new MyCanvas(this, wxPoint(0, 0), wxDefaultSize);
|
||||||
#if 0
|
#if 0
|
||||||
m_player.SetDestroyAnimation(FALSE);
|
m_player.SetDestroyAnimation(false);
|
||||||
m_player.SetWindow(m_canvas);
|
m_player.SetWindow(m_canvas);
|
||||||
m_player.SetPosition(wxPoint(0, 0));
|
m_player.SetPosition(wxPoint(0, 0));
|
||||||
#endif
|
#endif
|
||||||
@@ -146,6 +150,7 @@ void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event) )
|
|||||||
_T("About Animation Demo"));
|
_T("About Animation Demo"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if wxUSE_FILEDLG
|
||||||
void MyFrame::OnOpen(wxCommandEvent& WXUNUSED(event))
|
void MyFrame::OnOpen(wxCommandEvent& WXUNUSED(event))
|
||||||
{
|
{
|
||||||
wxFileDialog dialog(this, _T("Please choose an animated GIF"),
|
wxFileDialog dialog(this, _T("Please choose an animated GIF"),
|
||||||
@@ -165,6 +170,7 @@ void MyFrame::OnOpen(wxCommandEvent& WXUNUSED(event))
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif // wxUSE_FILEDLG
|
||||||
|
|
||||||
|
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
@@ -196,4 +202,3 @@ void MyCanvas::OnPaint(wxPaintEvent& WXUNUSED(event))
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -41,7 +41,9 @@ public:
|
|||||||
void OnAbout(wxCommandEvent& event);
|
void OnAbout(wxCommandEvent& event);
|
||||||
void OnQuit(wxCommandEvent& event);
|
void OnQuit(wxCommandEvent& event);
|
||||||
|
|
||||||
|
#if wxUSE_FILEDLG
|
||||||
void OnOpen(wxCommandEvent& event);
|
void OnOpen(wxCommandEvent& event);
|
||||||
|
#endif // wxUSE_FILEDLG
|
||||||
|
|
||||||
MyCanvas* GetCanvas() const { return m_canvas; }
|
MyCanvas* GetCanvas() const { return m_canvas; }
|
||||||
wxGIFAnimationCtrl* GetAnimationCtrl() const { return m_animationCtrl; }
|
wxGIFAnimationCtrl* GetAnimationCtrl() const { return m_animationCtrl; }
|
||||||
@@ -61,11 +63,3 @@ protected:
|
|||||||
wxGIFAnimation m_animation;
|
wxGIFAnimation m_animation;
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
// menu items ids
|
|
||||||
enum
|
|
||||||
{
|
|
||||||
ANITEST_QUIT = 100,
|
|
||||||
ANITEST_OPEN,
|
|
||||||
ANITEST_ABOUT
|
|
||||||
};
|
|
||||||
|
@@ -117,8 +117,10 @@ void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event))
|
|||||||
void MyFrame::OnToggleWindow(wxCommandEvent& WXUNUSED(event))
|
void MyFrame::OnToggleWindow(wxCommandEvent& WXUNUSED(event))
|
||||||
{
|
{
|
||||||
m_leftWindow1->Show(!m_leftWindow1->IsShown());
|
m_leftWindow1->Show(!m_leftWindow1->IsShown());
|
||||||
|
#if wxUSE_MDI_ARCHITECTURE
|
||||||
wxLayoutAlgorithm layout;
|
wxLayoutAlgorithm layout;
|
||||||
layout.LayoutMDIFrame(this);
|
layout.LayoutMDIFrame(this);
|
||||||
|
#endif // wxUSE_MDI_ARCHITECTURE
|
||||||
}
|
}
|
||||||
|
|
||||||
void MyFrame::OnFoldPanelBarDrag(wxSashEvent& event)
|
void MyFrame::OnFoldPanelBarDrag(wxSashEvent& event)
|
||||||
@@ -129,8 +131,10 @@ void MyFrame::OnFoldPanelBarDrag(wxSashEvent& event)
|
|||||||
if(event.GetId() == ID_WINDOW_LEFT1)
|
if(event.GetId() == ID_WINDOW_LEFT1)
|
||||||
m_leftWindow1->SetDefaultSize(wxSize(event.GetDragRect().width, 1000));
|
m_leftWindow1->SetDefaultSize(wxSize(event.GetDragRect().width, 1000));
|
||||||
|
|
||||||
|
#if wxUSE_MDI_ARCHITECTURE
|
||||||
wxLayoutAlgorithm layout;
|
wxLayoutAlgorithm layout;
|
||||||
layout.LayoutMDIFrame(this);
|
layout.LayoutMDIFrame(this);
|
||||||
|
#endif // wxUSE_MDI_ARCHITECTURE
|
||||||
|
|
||||||
// Leaves bits of itself behind sometimes
|
// Leaves bits of itself behind sometimes
|
||||||
GetClientWindow()->Refresh();
|
GetClientWindow()->Refresh();
|
||||||
@@ -496,8 +500,10 @@ void MyCanvas::OnEvent(wxMouseEvent& event)
|
|||||||
|
|
||||||
void MyFrame::OnSize(wxSizeEvent& WXUNUSED(event))
|
void MyFrame::OnSize(wxSizeEvent& WXUNUSED(event))
|
||||||
{
|
{
|
||||||
|
#if wxUSE_MDI_ARCHITECTURE
|
||||||
wxLayoutAlgorithm layout;
|
wxLayoutAlgorithm layout;
|
||||||
layout.LayoutMDIFrame(this);
|
layout.LayoutMDIFrame(this);
|
||||||
|
#endif // wxUSE_MDI_ARCHITECTURE
|
||||||
}
|
}
|
||||||
|
|
||||||
// Note that FPBTEST_NEW_WINDOW and FPBTEST_ABOUT commands get passed
|
// Note that FPBTEST_NEW_WINDOW and FPBTEST_ABOUT commands get passed
|
||||||
@@ -532,4 +538,3 @@ void MyChild::OnActivate(wxActivateEvent& event)
|
|||||||
if (event.GetActive() && canvas)
|
if (event.GetActive() && canvas)
|
||||||
canvas->SetFocus();
|
canvas->SetFocus();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -425,8 +425,10 @@ void MMBoardFrame::OnOpen(wxCommandEvent& WXUNUSED(event))
|
|||||||
}
|
}
|
||||||
|
|
||||||
// select a file to be opened
|
// select a file to be opened
|
||||||
|
#if wxUSE_FILEDLG
|
||||||
selected_file = wxLoadFileSelector(_T("multimedia"), _T("*"), NULL, this);
|
selected_file = wxLoadFileSelector(_T("multimedia"), _T("*"), NULL, this);
|
||||||
if (selected_file.IsNull())
|
#endif // wxUSE_FILEDLG
|
||||||
|
if (selected_file.empty())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
m_opened_file = MMBoardManager::Open(selected_file);
|
m_opened_file = MMBoardManager::Open(selected_file);
|
||||||
@@ -590,4 +592,3 @@ void MMBoardFrame::OnSetPosition(wxCommandEvent& WXUNUSED(event))
|
|||||||
|
|
||||||
UpdateMMedInfo();
|
UpdateMMedInfo();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -96,9 +96,12 @@ enum {
|
|||||||
//! global application name
|
//! global application name
|
||||||
extern wxString *g_appname;
|
extern wxString *g_appname;
|
||||||
|
|
||||||
|
#if wxUSE_PRINTING_ARCHITECTURE
|
||||||
|
|
||||||
//! global print data, to remember settings during the session
|
//! global print data, to remember settings during the session
|
||||||
extern wxPrintData *g_printData;
|
extern wxPrintData *g_printData;
|
||||||
extern wxPageSetupData *g_pageSetupData;
|
extern wxPageSetupData *g_pageSetupData;
|
||||||
|
|
||||||
#endif // _WX_DEFSEXT_H_
|
#endif // wxUSE_PRINTING_ARCHITECTURE
|
||||||
|
|
||||||
|
#endif // _WX_DEFSEXT_H_
|
||||||
|
@@ -139,6 +139,8 @@ private:
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#if wxUSE_PRINTING_ARCHITECTURE
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
//! EditPrint
|
//! EditPrint
|
||||||
class EditPrint: public wxPrintout {
|
class EditPrint: public wxPrintout {
|
||||||
@@ -165,5 +167,6 @@ private:
|
|||||||
bool PrintScaling (wxDC *dc);
|
bool PrintScaling (wxDC *dc);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // _EDIT_H_
|
#endif // wxUSE_PRINTING_ARCHITECTURE
|
||||||
|
|
||||||
|
#endif // _EDIT_H_
|
||||||
|
@@ -22,17 +22,17 @@
|
|||||||
// for all others, include the necessary headers (this file is usually all you
|
// for all others, include the necessary headers (this file is usually all you
|
||||||
// need because it includes almost all 'standard' wxWidgets headers)
|
// need because it includes almost all 'standard' wxWidgets headers)
|
||||||
#ifndef WX_PRECOMP
|
#ifndef WX_PRECOMP
|
||||||
#include <wx/wx.h>
|
#include "wx/wx.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//! wxWidgets headers
|
//! wxWidgets headers
|
||||||
#include <wx/config.h> // configuration support
|
#include "wx/config.h" // configuration support
|
||||||
#include <wx/filedlg.h> // file dialog support
|
#include "wx/filedlg.h" // file dialog support
|
||||||
#include <wx/filename.h> // filename support
|
#include "wx/filename.h" // filename support
|
||||||
#include <wx/notebook.h> // notebook support
|
#include "wx/notebook.h" // notebook support
|
||||||
#include <wx/settings.h> // system settings
|
#include "wx/settings.h" // system settings
|
||||||
#include <wx/string.h> // strings support
|
#include "wx/string.h" // strings support
|
||||||
#include <wx/image.h> // images support
|
#include "wx/image.h" // images support
|
||||||
|
|
||||||
//! application headers
|
//! application headers
|
||||||
#include "defsext.h" // Additional definitions
|
#include "defsext.h" // Additional definitions
|
||||||
@@ -76,10 +76,14 @@ class AppBook;
|
|||||||
//! global application name
|
//! global application name
|
||||||
wxString *g_appname = NULL;
|
wxString *g_appname = NULL;
|
||||||
|
|
||||||
|
#if wxUSE_PRINTING_ARCHITECTURE
|
||||||
|
|
||||||
//! global print data, to remember settings during the session
|
//! global print data, to remember settings during the session
|
||||||
wxPrintData *g_printData = (wxPrintData*) NULL;
|
wxPrintData *g_printData = (wxPrintData*) NULL;
|
||||||
wxPageSetupData *g_pageSetupData = (wxPageSetupData*) NULL;
|
wxPageSetupData *g_pageSetupData = (wxPageSetupData*) NULL;
|
||||||
|
|
||||||
|
#endif // wxUSE_PRINTING_ARCHITECTURE
|
||||||
|
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
//! application APP_VENDOR-APP_NAME.
|
//! application APP_VENDOR-APP_NAME.
|
||||||
@@ -200,9 +204,11 @@ bool App::OnInit () {
|
|||||||
g_appname->Append (_T("-"));
|
g_appname->Append (_T("-"));
|
||||||
g_appname->Append (APP_NAME);
|
g_appname->Append (APP_NAME);
|
||||||
|
|
||||||
|
#if wxUSE_PRINTING_ARCHITECTURE
|
||||||
// initialize print data and setup
|
// initialize print data and setup
|
||||||
g_printData = new wxPrintData;
|
g_printData = new wxPrintData;
|
||||||
g_pageSetupData = new wxPageSetupDialogData;
|
g_pageSetupData = new wxPageSetupDialogData;
|
||||||
|
#endif // wxUSE_PRINTING_ARCHITECTURE
|
||||||
|
|
||||||
// create application frame
|
// create application frame
|
||||||
m_frame = new AppFrame (*g_appname);
|
m_frame = new AppFrame (*g_appname);
|
||||||
@@ -220,9 +226,11 @@ int App::OnExit () {
|
|||||||
// delete global appname
|
// delete global appname
|
||||||
delete g_appname;
|
delete g_appname;
|
||||||
|
|
||||||
|
#if wxUSE_PRINTING_ARCHITECTURE
|
||||||
// delete global print data and setup
|
// delete global print data and setup
|
||||||
if (g_printData) delete g_printData;
|
if (g_printData) delete g_printData;
|
||||||
if (g_pageSetupData) delete g_pageSetupData;
|
if (g_pageSetupData) delete g_pageSetupData;
|
||||||
|
#endif // wxUSE_PRINTING_ARCHITECTURE
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -339,12 +347,14 @@ void AppFrame::OnExit (wxCommandEvent &WXUNUSED(event)) {
|
|||||||
// file event handlers
|
// file event handlers
|
||||||
void AppFrame::OnFileOpen (wxCommandEvent &WXUNUSED(event)) {
|
void AppFrame::OnFileOpen (wxCommandEvent &WXUNUSED(event)) {
|
||||||
if (!m_edit) return;
|
if (!m_edit) return;
|
||||||
|
#if wxUSE_FILEDLG
|
||||||
wxString fname;
|
wxString fname;
|
||||||
wxFileDialog dlg (this, _T("Open file"), _T(""), _T(""), _T("Any file (*)|*"),
|
wxFileDialog dlg (this, _T("Open file"), wxEmptyString, wxEmptyString, _T("Any file (*)|*"),
|
||||||
wxOPEN | wxFILE_MUST_EXIST | wxCHANGE_DIR);
|
wxOPEN | wxFILE_MUST_EXIST | wxCHANGE_DIR);
|
||||||
if (dlg.ShowModal() != wxID_OK) return;
|
if (dlg.ShowModal() != wxID_OK) return;
|
||||||
fname = dlg.GetPath ();
|
fname = dlg.GetPath ();
|
||||||
FileOpen (fname);
|
FileOpen (fname);
|
||||||
|
#endif // wxUSE_FILEDLG
|
||||||
}
|
}
|
||||||
|
|
||||||
void AppFrame::OnFileSave (wxCommandEvent &WXUNUSED(event)) {
|
void AppFrame::OnFileSave (wxCommandEvent &WXUNUSED(event)) {
|
||||||
@@ -359,11 +369,13 @@ void AppFrame::OnFileSave (wxCommandEvent &WXUNUSED(event)) {
|
|||||||
|
|
||||||
void AppFrame::OnFileSaveAs (wxCommandEvent &WXUNUSED(event)) {
|
void AppFrame::OnFileSaveAs (wxCommandEvent &WXUNUSED(event)) {
|
||||||
if (!m_edit) return;
|
if (!m_edit) return;
|
||||||
|
#if wxUSE_FILEDLG
|
||||||
wxString filename = wxEmptyString;
|
wxString filename = wxEmptyString;
|
||||||
wxFileDialog dlg (this, _T("Save file"), _T(""), _T(""), _T("Any file (*)|*"), wxSAVE|wxOVERWRITE_PROMPT);
|
wxFileDialog dlg (this, _T("Save file"), wxEmptyString, wxEmptyString, _T("Any file (*)|*"), wxSAVE|wxOVERWRITE_PROMPT);
|
||||||
if (dlg.ShowModal() != wxID_OK) return;
|
if (dlg.ShowModal() != wxID_OK) return;
|
||||||
filename = dlg.GetPath();
|
filename = dlg.GetPath();
|
||||||
m_edit->SaveFile (filename);
|
m_edit->SaveFile (filename);
|
||||||
|
#endif // wxUSE_FILEDLG
|
||||||
}
|
}
|
||||||
|
|
||||||
void AppFrame::OnFileClose (wxCommandEvent &WXUNUSED(event)) {
|
void AppFrame::OnFileClose (wxCommandEvent &WXUNUSED(event)) {
|
||||||
@@ -392,14 +404,17 @@ void AppFrame::OnProperties (wxCommandEvent &WXUNUSED(event)) {
|
|||||||
|
|
||||||
// print event handlers
|
// print event handlers
|
||||||
void AppFrame::OnPrintSetup (wxCommandEvent &WXUNUSED(event)) {
|
void AppFrame::OnPrintSetup (wxCommandEvent &WXUNUSED(event)) {
|
||||||
|
#if wxUSE_PRINTING_ARCHITECTURE
|
||||||
(*g_pageSetupData) = * g_printData;
|
(*g_pageSetupData) = * g_printData;
|
||||||
wxPageSetupDialog pageSetupDialog(this, g_pageSetupData);
|
wxPageSetupDialog pageSetupDialog(this, g_pageSetupData);
|
||||||
pageSetupDialog.ShowModal();
|
pageSetupDialog.ShowModal();
|
||||||
(*g_printData) = pageSetupDialog.GetPageSetupData().GetPrintData();
|
(*g_printData) = pageSetupDialog.GetPageSetupData().GetPrintData();
|
||||||
(*g_pageSetupData) = pageSetupDialog.GetPageSetupData();
|
(*g_pageSetupData) = pageSetupDialog.GetPageSetupData();
|
||||||
|
#endif // wxUSE_PRINTING_ARCHITECTURE
|
||||||
}
|
}
|
||||||
|
|
||||||
void AppFrame::OnPrintPreview (wxCommandEvent &WXUNUSED(event)) {
|
void AppFrame::OnPrintPreview (wxCommandEvent &WXUNUSED(event)) {
|
||||||
|
#if wxUSE_PRINTING_ARCHITECTURE
|
||||||
wxPrintDialogData printDialogData( *g_printData);
|
wxPrintDialogData printDialogData( *g_printData);
|
||||||
wxPrintPreview *preview =
|
wxPrintPreview *preview =
|
||||||
new wxPrintPreview (new EditPrint (m_edit),
|
new wxPrintPreview (new EditPrint (m_edit),
|
||||||
@@ -418,9 +433,11 @@ void AppFrame::OnPrintPreview (wxCommandEvent &WXUNUSED(event)) {
|
|||||||
frame->Centre(wxBOTH);
|
frame->Centre(wxBOTH);
|
||||||
frame->Initialize();
|
frame->Initialize();
|
||||||
frame->Show(true);
|
frame->Show(true);
|
||||||
|
#endif // wxUSE_PRINTING_ARCHITECTURE
|
||||||
}
|
}
|
||||||
|
|
||||||
void AppFrame::OnPrint (wxCommandEvent &WXUNUSED(event)) {
|
void AppFrame::OnPrint (wxCommandEvent &WXUNUSED(event)) {
|
||||||
|
#if wxUSE_PRINTING_ARCHITECTURE
|
||||||
wxPrintDialogData printDialogData( *g_printData);
|
wxPrintDialogData printDialogData( *g_printData);
|
||||||
wxPrinter printer (&printDialogData);
|
wxPrinter printer (&printDialogData);
|
||||||
EditPrint printout (m_edit);
|
EditPrint printout (m_edit);
|
||||||
@@ -433,6 +450,7 @@ void AppFrame::OnPrint (wxCommandEvent &WXUNUSED(event)) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
(*g_printData) = printer.GetPrintDialogData().GetPrintData();
|
(*g_printData) = printer.GetPrintDialogData().GetPrintData();
|
||||||
|
#endif // wxUSE_PRINTING_ARCHITECTURE
|
||||||
}
|
}
|
||||||
|
|
||||||
// edit events
|
// edit events
|
||||||
@@ -441,8 +459,8 @@ void AppFrame::OnEdit (wxCommandEvent &event) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// private functions
|
// private functions
|
||||||
void AppFrame::CreateMenu () {
|
void AppFrame::CreateMenu ()
|
||||||
|
{
|
||||||
// File menu
|
// File menu
|
||||||
wxMenu *menuFile = new wxMenu;
|
wxMenu *menuFile = new wxMenu;
|
||||||
menuFile->Append (wxID_OPEN, _("&Open ..\tCtrl+O"));
|
menuFile->Append (wxID_OPEN, _("&Open ..\tCtrl+O"));
|
||||||
@@ -552,10 +570,10 @@ void AppFrame::CreateMenu () {
|
|||||||
m_menuBar->Append (menuWindow, _("&Window"));
|
m_menuBar->Append (menuWindow, _("&Window"));
|
||||||
m_menuBar->Append (menuHelp, _("&Help"));
|
m_menuBar->Append (menuHelp, _("&Help"));
|
||||||
SetMenuBar (m_menuBar);
|
SetMenuBar (m_menuBar);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void AppFrame::FileOpen (wxString fname) {
|
void AppFrame::FileOpen (wxString fname)
|
||||||
|
{
|
||||||
wxFileName w(fname); w.Normalize(); fname = w.GetFullPath();
|
wxFileName w(fname); w.Normalize(); fname = w.GetFullPath();
|
||||||
m_edit->LoadFile (fname);
|
m_edit->LoadFile (fname);
|
||||||
}
|
}
|
||||||
@@ -661,4 +679,3 @@ void AppAbout::OnTimerEvent (wxTimerEvent &WXUNUSED(event)) {
|
|||||||
m_timer = NULL;
|
m_timer = NULL;
|
||||||
EndModal (wxID_OK);
|
EndModal (wxID_OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -187,7 +187,7 @@ bool MyApp::OnInit()
|
|||||||
|
|
||||||
SetTopWindow(frame);
|
SetTopWindow(frame);
|
||||||
|
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -298,7 +298,7 @@ void MyFrame::OnNewWindow(wxCommandEvent& WXUNUSED(event) )
|
|||||||
// Associate the menu bar with the frame
|
// Associate the menu bar with the frame
|
||||||
subframe->SetMenuBar(menu_bar);
|
subframe->SetMenuBar(menu_bar);
|
||||||
|
|
||||||
subframe->Show(TRUE);
|
subframe->Show(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -324,12 +324,12 @@ void MyFrame::InitToolBar(wxToolBar* toolBar)
|
|||||||
int width = 16;
|
int width = 16;
|
||||||
int currentX = 5;
|
int currentX = 5;
|
||||||
|
|
||||||
toolBar->AddTool( MDI_NEW_WINDOW, *(bitmaps[0]), wxNullBitmap, FALSE, currentX, -1, (wxObject *) NULL, wxT("New SVG test window"));
|
toolBar->AddTool( MDI_NEW_WINDOW, *(bitmaps[0]), wxNullBitmap, false, currentX, wxDefaultCoord, (wxObject *) NULL, wxT("New SVG test window"));
|
||||||
currentX += width + 5;
|
currentX += width + 5;
|
||||||
toolBar->AddTool( MDI_SAVE, *bitmaps[1], wxNullBitmap, FALSE, currentX, -1, (wxObject *) NULL, wxT("Save test in SVG format"));
|
toolBar->AddTool( MDI_SAVE, *bitmaps[1], wxNullBitmap, false, currentX, wxDefaultCoord, (wxObject *) NULL, wxT("Save test in SVG format"));
|
||||||
currentX += width + 5;
|
currentX += width + 5;
|
||||||
toolBar->AddSeparator();
|
toolBar->AddSeparator();
|
||||||
toolBar->AddTool(MDI_ABOUT, *bitmaps[2], wxNullBitmap, FALSE, currentX, -1, (wxObject *) NULL, wxT("Help"));
|
toolBar->AddTool(MDI_ABOUT, *bitmaps[2], wxNullBitmap, false, currentX, wxDefaultCoord, (wxObject *) NULL, wxT("Help"));
|
||||||
|
|
||||||
toolBar->Realize();
|
toolBar->Realize();
|
||||||
|
|
||||||
@@ -341,6 +341,7 @@ void MyFrame::InitToolBar(wxToolBar* toolBar)
|
|||||||
|
|
||||||
void MyFrame::FileSavePicture (wxCommandEvent & WXUNUSED(event) )
|
void MyFrame::FileSavePicture (wxCommandEvent & WXUNUSED(event) )
|
||||||
{
|
{
|
||||||
|
#if wxUSE_FILEDLG
|
||||||
MyChild * pChild = (MyChild *)GetActiveChild ();
|
MyChild * pChild = (MyChild *)GetActiveChild ();
|
||||||
if (pChild == NULL)
|
if (pChild == NULL)
|
||||||
{
|
{
|
||||||
@@ -359,6 +360,7 @@ void MyFrame::FileSavePicture (wxCommandEvent & WXUNUSED(event) )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
return ;
|
return ;
|
||||||
|
#endif // wxUSE_FILEDLG
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -464,7 +466,7 @@ void MyCanvas::OnDraw(wxDC& dc)
|
|||||||
dc.DrawText(wxT("This is a Red string"), 50, 200);
|
dc.DrawText(wxT("This is a Red string"), 50, 200);
|
||||||
dc.DrawRotatedText(wxT("This is a 45 deg string"), 50, 200, 45);
|
dc.DrawRotatedText(wxT("This is a 45 deg string"), 50, 200, 45);
|
||||||
dc.DrawRotatedText(wxT("This is a 90 deg string"), 50, 200, 90);
|
dc.DrawRotatedText(wxT("This is a 90 deg string"), 50, 200, 90);
|
||||||
wF = wxFont ( 18, wxROMAN, wxITALIC, wxBOLD, FALSE, wxT("Times New Roman"));
|
wF = wxFont ( 18, wxROMAN, wxITALIC, wxBOLD, false, wxT("Times New Roman"));
|
||||||
dc.SetFont(wF);
|
dc.SetFont(wF);
|
||||||
dc.SetTextForeground (wC) ;
|
dc.SetTextForeground (wC) ;
|
||||||
dc.DrawText(wxT("This is a Times-style string"), 50, 60);
|
dc.DrawText(wxT("This is a Times-style string"), 50, 60);
|
||||||
@@ -520,7 +522,7 @@ void MyCanvas::OnDraw(wxDC& dc)
|
|||||||
break ;
|
break ;
|
||||||
|
|
||||||
case 5:
|
case 5:
|
||||||
wF = wxFont ( 18, wxROMAN, wxITALIC, wxBOLD, FALSE, wxT("Times New Roman"));
|
wF = wxFont ( 18, wxROMAN, wxITALIC, wxBOLD, false, wxT("Times New Roman"));
|
||||||
dc.SetFont(wF);
|
dc.SetFont(wF);
|
||||||
dc.DrawLine(0, 0, 200, 200);
|
dc.DrawLine(0, 0, 200, 200);
|
||||||
dc.DrawLine(200, 0, 0, 200);
|
dc.DrawLine(200, 0, 0, 200);
|
||||||
@@ -601,7 +603,7 @@ MyChild::~MyChild()
|
|||||||
|
|
||||||
void MyChild::OnQuit(wxCommandEvent& WXUNUSED(event))
|
void MyChild::OnQuit(wxCommandEvent& WXUNUSED(event))
|
||||||
{
|
{
|
||||||
Close(TRUE);
|
Close(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -1341,6 +1341,7 @@ void wxFilenameListValidator::OnEdit(wxProperty *property, wxPropertyListView *v
|
|||||||
if (!view->GetValueText())
|
if (!view->GetValueText())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
#if wxUSE_FILEDLG
|
||||||
wxString s = wxFileSelector(
|
wxString s = wxFileSelector(
|
||||||
m_filenameMessage.GetData(),
|
m_filenameMessage.GetData(),
|
||||||
wxPathOnly(property->GetValue().StringValue()),
|
wxPathOnly(property->GetValue().StringValue()),
|
||||||
@@ -1356,6 +1357,11 @@ void wxFilenameListValidator::OnEdit(wxProperty *property, wxPropertyListView *v
|
|||||||
view->UpdatePropertyDisplayInList(property);
|
view->UpdatePropertyDisplayInList(property);
|
||||||
view->OnPropertyChanged(property);
|
view->OnPropertyChanged(property);
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
wxUnusedVar(property);
|
||||||
|
wxUnusedVar(view);
|
||||||
|
wxUnusedVar(parentWindow);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
///
|
///
|
||||||
@@ -1575,7 +1581,7 @@ void wxListOfStringsListValidator::OnEdit( wxProperty *property,
|
|||||||
|
|
||||||
class wxPropertyStringListEditorDialog: public wxDialog
|
class wxPropertyStringListEditorDialog: public wxDialog
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
wxPropertyStringListEditorDialog(wxWindow *parent, const wxString& title,
|
wxPropertyStringListEditorDialog(wxWindow *parent, const wxString& title,
|
||||||
const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
|
const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
|
||||||
long windowStyle = wxDEFAULT_DIALOG_STYLE, const wxString& name = wxT("stringEditorDialogBox")):
|
long windowStyle = wxDEFAULT_DIALOG_STYLE, const wxString& name = wxT("stringEditorDialogBox")):
|
||||||
@@ -1755,7 +1761,7 @@ void wxPropertyStringListEditorDialog::OnOK(wxCommandEvent& WXUNUSED(event))
|
|||||||
{
|
{
|
||||||
SaveCurrentSelection();
|
SaveCurrentSelection();
|
||||||
EndModal(wxID_OK);
|
EndModal(wxID_OK);
|
||||||
// Close(true);
|
// Close(true);
|
||||||
this->Destroy();
|
this->Destroy();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -352,7 +352,7 @@ bool wxFrameLayout::CanReparent()
|
|||||||
#ifdef __WXMSW__
|
#ifdef __WXMSW__
|
||||||
return true;
|
return true;
|
||||||
#elif defined(__WXGTK20__)
|
#elif defined(__WXGTK20__)
|
||||||
return TRUE;
|
return true;
|
||||||
#elif defined (__WXGTK__)
|
#elif defined (__WXGTK__)
|
||||||
//return true;
|
//return true;
|
||||||
return false;
|
return false;
|
||||||
@@ -402,6 +402,8 @@ void wxFrameLayout::ReparentWindow( wxWindow* pChild, wxWindow* pNewParent )
|
|||||||
|
|
||||||
//return;
|
//return;
|
||||||
#else
|
#else
|
||||||
|
wxUnusedVar(pChild);
|
||||||
|
wxUnusedVar(pNewParent);
|
||||||
wxMessageBox( "Sorry, docking is not supported for ports other than MSW and wxGTK" );
|
wxMessageBox( "Sorry, docking is not supported for ports other than MSW and wxGTK" );
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
@@ -1728,7 +1730,6 @@ void wxFrameLayout::AddPluginBefore( wxClassInfo* pNextPlInfo, wxClassInfo* pPlI
|
|||||||
// insert it to the chain
|
// insert it to the chain
|
||||||
|
|
||||||
if ( pNextPl->GetPreviousHandler() )
|
if ( pNextPl->GetPreviousHandler() )
|
||||||
|
|
||||||
pNextPl->GetPreviousHandler()->SetNextHandler( pNewPl );
|
pNextPl->GetPreviousHandler()->SetNextHandler( pNewPl );
|
||||||
else
|
else
|
||||||
mpTopPlugin = pNewPl;
|
mpTopPlugin = pNewPl;
|
||||||
@@ -1845,7 +1846,6 @@ bool wxBarIterator::Next()
|
|||||||
mpRow = mpRow->mpNext;
|
mpRow = mpRow->mpNext;
|
||||||
|
|
||||||
if ( mpRow )
|
if ( mpRow )
|
||||||
|
|
||||||
mpBar = mpRow->mBars[0];
|
mpBar = mpRow->mBars[0];
|
||||||
else
|
else
|
||||||
return false;
|
return false;
|
||||||
@@ -3006,7 +3006,6 @@ int cbDockPane::GetPaneHeight()
|
|||||||
int height = 0;
|
int height = 0;
|
||||||
|
|
||||||
if ( IsHorizontal() )
|
if ( IsHorizontal() )
|
||||||
|
|
||||||
height += mTopMargin + mBottomMargin;
|
height += mTopMargin + mBottomMargin;
|
||||||
else
|
else
|
||||||
height += mLeftMargin + mRightMargin;
|
height += mLeftMargin + mRightMargin;
|
||||||
@@ -3014,7 +3013,6 @@ int cbDockPane::GetPaneHeight()
|
|||||||
int count = mRows.Count();
|
int count = mRows.Count();
|
||||||
|
|
||||||
if ( count )
|
if ( count )
|
||||||
|
|
||||||
height += mRows[count-1]->mRowY + mRows[count-1]->mRowHeight;
|
height += mRows[count-1]->mRowY + mRows[count-1]->mRowHeight;
|
||||||
|
|
||||||
return height;
|
return height;
|
||||||
@@ -3182,7 +3180,6 @@ void cbDockPane::GetBarResizeRange( cbBarInfo* pBar, int* from, int *till,
|
|||||||
// treat not-fixed bars as minimized
|
// treat not-fixed bars as minimized
|
||||||
|
|
||||||
if ( !pBar->IsFixed() )
|
if ( !pBar->IsFixed() )
|
||||||
|
|
||||||
notFree += mProps.mMinCBarDim.x;
|
notFree += mProps.mMinCBarDim.x;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -3202,10 +3199,8 @@ void cbDockPane::GetBarResizeRange( cbBarInfo* pBar, int* from, int *till,
|
|||||||
// do not let resizing totally deform the bar itself
|
// do not let resizing totally deform the bar itself
|
||||||
|
|
||||||
if ( forLeftHandle )
|
if ( forLeftHandle )
|
||||||
|
|
||||||
(*till) -= mProps.mMinCBarDim.x;
|
(*till) -= mProps.mMinCBarDim.x;
|
||||||
else
|
else
|
||||||
|
|
||||||
(*from) += mProps.mMinCBarDim.x;
|
(*from) += mProps.mMinCBarDim.x;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3543,4 +3538,3 @@ bool cbPluginBase::ProcessEvent(wxEvent& event)
|
|||||||
else
|
else
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -513,7 +513,8 @@ void wxNewBitmapButton::RenderLabelImage( wxBitmap*& destBmp, wxBitmap* srcBmp,
|
|||||||
#ifdef __WXMSW__ // This is currently MSW specific
|
#ifdef __WXMSW__ // This is currently MSW specific
|
||||||
gray_out_image_on_dc( destDc, destDim.x, destDim.y );
|
gray_out_image_on_dc( destDc, destDim.x, destDim.y );
|
||||||
#else
|
#else
|
||||||
wxBrush checkerBrush( wxBitmap( (const char*)_gDisableImage,8,8) );
|
wxBitmap bmp( (const char*)_gDisableImage,8,8);
|
||||||
|
wxBrush checkerBrush(bmp);
|
||||||
checkerBrush.SetColour( wxSystemSettings::GetColour( wxSYS_COLOUR_BTNFACE ) );
|
checkerBrush.SetColour( wxSystemSettings::GetColour( wxSYS_COLOUR_BTNFACE ) );
|
||||||
destDc.SetBrush( checkerBrush );
|
destDc.SetBrush( checkerBrush );
|
||||||
destDc.DrawRectangle( imgPos.x, imgPos.y, srcBmp->GetWidth()+1, srcBmp->GetHeight()+1);
|
destDc.DrawRectangle( imgPos.x, imgPos.y, srcBmp->GetWidth()+1, srcBmp->GetHeight()+1);
|
||||||
|
@@ -232,7 +232,7 @@ void wxRemotelyScrolledTreeCtrl::ScrollToLine(int WXUNUSED(posHoriz), int posVer
|
|||||||
#ifdef __WXMSW__
|
#ifdef __WXMSW__
|
||||||
#if USE_GENERIC_TREECTRL
|
#if USE_GENERIC_TREECTRL
|
||||||
if (!IsKindOf(CLASSINFO(wxGenericTreeCtrl)))
|
if (!IsKindOf(CLASSINFO(wxGenericTreeCtrl)))
|
||||||
#endif
|
#endif // USE_GENERIC_TREECTRL
|
||||||
{
|
{
|
||||||
UINT sbCode = SB_THUMBPOSITION;
|
UINT sbCode = SB_THUMBPOSITION;
|
||||||
HWND vertScrollBar = 0;
|
HWND vertScrollBar = 0;
|
||||||
@@ -240,8 +240,8 @@ void wxRemotelyScrolledTreeCtrl::ScrollToLine(int WXUNUSED(posHoriz), int posVer
|
|||||||
}
|
}
|
||||||
#if USE_GENERIC_TREECTRL
|
#if USE_GENERIC_TREECTRL
|
||||||
else
|
else
|
||||||
#endif
|
#endif // USE_GENERIC_TREECTRL
|
||||||
#endif
|
#endif // __WXMSW__
|
||||||
#if USE_GENERIC_TREECTRL || !defined(__WXMSW__)
|
#if USE_GENERIC_TREECTRL || !defined(__WXMSW__)
|
||||||
{
|
{
|
||||||
wxGenericTreeCtrl* win = (wxGenericTreeCtrl*) this;
|
wxGenericTreeCtrl* win = (wxGenericTreeCtrl*) this;
|
||||||
@@ -256,7 +256,8 @@ void wxRemotelyScrolledTreeCtrl::ScrollToLine(int WXUNUSED(posHoriz), int posVer
|
|||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
#endif
|
#endif // USE_GENERIC_TREECTRL || !defined(__WXMSW__)
|
||||||
|
wxUnusedVar(posVert);
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxRemotelyScrolledTreeCtrl::OnSize(wxSizeEvent& event)
|
void wxRemotelyScrolledTreeCtrl::OnSize(wxSizeEvent& event)
|
||||||
@@ -745,4 +746,3 @@ void wxSplitterScrolledWindow::OnScroll(wxScrollWinEvent& event)
|
|||||||
|
|
||||||
inOnScroll = false;
|
inOnScroll = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -154,6 +154,7 @@ END_EVENT_TABLE()
|
|||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
|
|
||||||
|
#if wxUSE_DATAOBJ
|
||||||
static wxTextFileType wxConvertEOLMode(int scintillaMode)
|
static wxTextFileType wxConvertEOLMode(int scintillaMode)
|
||||||
{
|
{
|
||||||
wxTextFileType type;
|
wxTextFileType type;
|
||||||
@@ -177,6 +178,7 @@ static wxTextFileType wxConvertEOLMode(int scintillaMode)
|
|||||||
}
|
}
|
||||||
return type;
|
return type;
|
||||||
}
|
}
|
||||||
|
#endif // wxUSE_DATAOBJ
|
||||||
|
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
@@ -439,6 +441,7 @@ void ScintillaWX::Paste() {
|
|||||||
pdoc->BeginUndoAction();
|
pdoc->BeginUndoAction();
|
||||||
ClearSelection();
|
ClearSelection();
|
||||||
|
|
||||||
|
#if wxUSE_DATAOBJ
|
||||||
wxTextDataObject data;
|
wxTextDataObject data;
|
||||||
bool gotData = false;
|
bool gotData = false;
|
||||||
|
|
||||||
@@ -455,6 +458,7 @@ void ScintillaWX::Paste() {
|
|||||||
pdoc->InsertString(currentPos, buf, len);
|
pdoc->InsertString(currentPos, buf, len);
|
||||||
SetEmptySelection(currentPos + len);
|
SetEmptySelection(currentPos + len);
|
||||||
}
|
}
|
||||||
|
#endif // wxUSE_DATAOBJ
|
||||||
|
|
||||||
pdoc->EndUndoAction();
|
pdoc->EndUndoAction();
|
||||||
NotifyChange();
|
NotifyChange();
|
||||||
@@ -463,16 +467,21 @@ void ScintillaWX::Paste() {
|
|||||||
|
|
||||||
|
|
||||||
void ScintillaWX::CopyToClipboard(const SelectionText& st) {
|
void ScintillaWX::CopyToClipboard(const SelectionText& st) {
|
||||||
|
#if wxUSE_CLIPBOARD
|
||||||
if (wxTheClipboard->Open()) {
|
if (wxTheClipboard->Open()) {
|
||||||
wxTheClipboard->UsePrimarySelection(false);
|
wxTheClipboard->UsePrimarySelection(false);
|
||||||
wxString text = wxTextBuffer::Translate(stc2wx(st.s, st.len-1));
|
wxString text = wxTextBuffer::Translate(stc2wx(st.s, st.len-1));
|
||||||
wxTheClipboard->SetData(new wxTextDataObject(text));
|
wxTheClipboard->SetData(new wxTextDataObject(text));
|
||||||
wxTheClipboard->Close();
|
wxTheClipboard->Close();
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
wxUnusedVar(st);
|
||||||
|
#endif // wxUSE_CLIPBOARD
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool ScintillaWX::CanPaste() {
|
bool ScintillaWX::CanPaste() {
|
||||||
|
#if wxUSE_CLIPBOARD
|
||||||
bool canPaste = false;
|
bool canPaste = false;
|
||||||
bool didOpen;
|
bool didOpen;
|
||||||
|
|
||||||
@@ -489,6 +498,9 @@ bool ScintillaWX::CanPaste() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
return canPaste;
|
return canPaste;
|
||||||
|
#else
|
||||||
|
return false;
|
||||||
|
#endif // wxUSE_CLIPBOARD
|
||||||
}
|
}
|
||||||
|
|
||||||
void ScintillaWX::CreateCallTipWindow(PRectangle) {
|
void ScintillaWX::CreateCallTipWindow(PRectangle) {
|
||||||
|
@@ -127,6 +127,7 @@ void wxMainFrame::OnQuit(wxCommandEvent& WXUNUSED(event))
|
|||||||
|
|
||||||
void wxMainFrame::OnRc2Wxr(wxCommandEvent& WXUNUSED(event))
|
void wxMainFrame::OnRc2Wxr(wxCommandEvent& WXUNUSED(event))
|
||||||
{
|
{
|
||||||
|
#if wxUSE_FILEDLG
|
||||||
wxFileDialog filed(this);
|
wxFileDialog filed(this);
|
||||||
filed.SetWildcard(_T("*.rc"));
|
filed.SetWildcard(_T("*.rc"));
|
||||||
filed.SetStyle(wxOPEN);
|
filed.SetStyle(wxOPEN);
|
||||||
@@ -144,10 +145,12 @@ void wxMainFrame::OnRc2Wxr(wxCommandEvent& WXUNUSED(event))
|
|||||||
|
|
||||||
rc2wxr convert;
|
rc2wxr convert;
|
||||||
convert.Convert(wxrfile.GetPath(),filed.GetPath());
|
convert.Convert(wxrfile.GetPath(),filed.GetPath());
|
||||||
|
#endif // wxUSE_FILEDLG
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxMainFrame::OnWXR2XML(wxCommandEvent& WXUNUSED(event))
|
void wxMainFrame::OnWXR2XML(wxCommandEvent& WXUNUSED(event))
|
||||||
{
|
{
|
||||||
|
#if wxUSE_FILEDLG
|
||||||
wxFileDialog f(this);
|
wxFileDialog f(this);
|
||||||
f.SetWildcard(_T("*.wxr"));
|
f.SetWildcard(_T("*.wxr"));
|
||||||
if (f.ShowModal()!=wxID_OK)
|
if (f.ShowModal()!=wxID_OK)
|
||||||
@@ -164,11 +167,12 @@ void wxMainFrame::OnWXR2XML(wxCommandEvent& WXUNUSED(event))
|
|||||||
|
|
||||||
wxr2xml XMLCon;
|
wxr2xml XMLCon;
|
||||||
XMLCon.Convert(f.GetPath(),xmlfile.GetPath());
|
XMLCon.Convert(f.GetPath(),xmlfile.GetPath());
|
||||||
|
#endif // wxUSE_FILEDLG
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxMainFrame::OnRC2XML(wxCommandEvent& WXUNUSED(event))
|
void wxMainFrame::OnRC2XML(wxCommandEvent& WXUNUSED(event))
|
||||||
{
|
{
|
||||||
|
#if wxUSE_FILEDLG
|
||||||
wxFileDialog f(this);
|
wxFileDialog f(this);
|
||||||
f.SetWildcard(_T("*.rc"));
|
f.SetWildcard(_T("*.rc"));
|
||||||
if (f.ShowModal()!=wxID_OK)
|
if (f.ShowModal()!=wxID_OK)
|
||||||
@@ -184,7 +188,7 @@ void wxMainFrame::OnRC2XML(wxCommandEvent& WXUNUSED(event))
|
|||||||
|
|
||||||
rc2xml XMLCon;
|
rc2xml XMLCon;
|
||||||
XMLCon.Convert(f.GetPath(),xmlfile.GetPath());
|
XMLCon.Convert(f.GetPath(),xmlfile.GetPath());
|
||||||
|
#endif // wxUSE_FILEDLG
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxConvertApp::HandleCommandLine()
|
bool wxConvertApp::HandleCommandLine()
|
||||||
|
@@ -96,9 +96,12 @@ enum {
|
|||||||
//! global application name
|
//! global application name
|
||||||
extern wxString *g_appname;
|
extern wxString *g_appname;
|
||||||
|
|
||||||
|
#if wxUSE_PRINTING_ARCHITECTURE
|
||||||
|
|
||||||
//! global print data, to remember settings during the session
|
//! global print data, to remember settings during the session
|
||||||
extern wxPrintData *g_printData;
|
extern wxPrintData *g_printData;
|
||||||
extern wxPageSetupData *g_pageSetupData;
|
extern wxPageSetupData *g_pageSetupData;
|
||||||
|
|
||||||
#endif // _WX_DEFSEXT_H_
|
#endif // wxUSE_PRINTING_ARCHITECTURE
|
||||||
|
|
||||||
|
#endif // _WX_DEFSEXT_H_
|
||||||
|
@@ -139,6 +139,8 @@ private:
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#if wxUSE_PRINTING_ARCHITECTURE
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
//! EditPrint
|
//! EditPrint
|
||||||
class EditPrint: public wxPrintout {
|
class EditPrint: public wxPrintout {
|
||||||
@@ -165,5 +167,6 @@ private:
|
|||||||
bool PrintScaling (wxDC *dc);
|
bool PrintScaling (wxDC *dc);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // _EDIT_H_
|
#endif // wxUSE_PRINTING_ARCHITECTURE
|
||||||
|
|
||||||
|
#endif // _EDIT_H_
|
||||||
|
@@ -22,17 +22,17 @@
|
|||||||
// for all others, include the necessary headers (this file is usually all you
|
// for all others, include the necessary headers (this file is usually all you
|
||||||
// need because it includes almost all 'standard' wxWidgets headers)
|
// need because it includes almost all 'standard' wxWidgets headers)
|
||||||
#ifndef WX_PRECOMP
|
#ifndef WX_PRECOMP
|
||||||
#include <wx/wx.h>
|
#include "wx/wx.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//! wxWidgets headers
|
//! wxWidgets headers
|
||||||
#include <wx/config.h> // configuration support
|
#include "wx/config.h" // configuration support
|
||||||
#include <wx/filedlg.h> // file dialog support
|
#include "wx/filedlg.h" // file dialog support
|
||||||
#include <wx/filename.h> // filename support
|
#include "wx/filename.h" // filename support
|
||||||
#include <wx/notebook.h> // notebook support
|
#include "wx/notebook.h" // notebook support
|
||||||
#include <wx/settings.h> // system settings
|
#include "wx/settings.h" // system settings
|
||||||
#include <wx/string.h> // strings support
|
#include "wx/string.h" // strings support
|
||||||
#include <wx/image.h> // images support
|
#include "wx/image.h" // images support
|
||||||
|
|
||||||
//! application headers
|
//! application headers
|
||||||
#include "defsext.h" // Additional definitions
|
#include "defsext.h" // Additional definitions
|
||||||
@@ -76,10 +76,14 @@ class AppBook;
|
|||||||
//! global application name
|
//! global application name
|
||||||
wxString *g_appname = NULL;
|
wxString *g_appname = NULL;
|
||||||
|
|
||||||
|
#if wxUSE_PRINTING_ARCHITECTURE
|
||||||
|
|
||||||
//! global print data, to remember settings during the session
|
//! global print data, to remember settings during the session
|
||||||
wxPrintData *g_printData = (wxPrintData*) NULL;
|
wxPrintData *g_printData = (wxPrintData*) NULL;
|
||||||
wxPageSetupData *g_pageSetupData = (wxPageSetupData*) NULL;
|
wxPageSetupData *g_pageSetupData = (wxPageSetupData*) NULL;
|
||||||
|
|
||||||
|
#endif // wxUSE_PRINTING_ARCHITECTURE
|
||||||
|
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
//! application APP_VENDOR-APP_NAME.
|
//! application APP_VENDOR-APP_NAME.
|
||||||
@@ -200,9 +204,11 @@ bool App::OnInit () {
|
|||||||
g_appname->Append (_T("-"));
|
g_appname->Append (_T("-"));
|
||||||
g_appname->Append (APP_NAME);
|
g_appname->Append (APP_NAME);
|
||||||
|
|
||||||
|
#if wxUSE_PRINTING_ARCHITECTURE
|
||||||
// initialize print data and setup
|
// initialize print data and setup
|
||||||
g_printData = new wxPrintData;
|
g_printData = new wxPrintData;
|
||||||
g_pageSetupData = new wxPageSetupDialogData;
|
g_pageSetupData = new wxPageSetupDialogData;
|
||||||
|
#endif // wxUSE_PRINTING_ARCHITECTURE
|
||||||
|
|
||||||
// create application frame
|
// create application frame
|
||||||
m_frame = new AppFrame (*g_appname);
|
m_frame = new AppFrame (*g_appname);
|
||||||
@@ -220,9 +226,11 @@ int App::OnExit () {
|
|||||||
// delete global appname
|
// delete global appname
|
||||||
delete g_appname;
|
delete g_appname;
|
||||||
|
|
||||||
|
#if wxUSE_PRINTING_ARCHITECTURE
|
||||||
// delete global print data and setup
|
// delete global print data and setup
|
||||||
if (g_printData) delete g_printData;
|
if (g_printData) delete g_printData;
|
||||||
if (g_pageSetupData) delete g_pageSetupData;
|
if (g_pageSetupData) delete g_pageSetupData;
|
||||||
|
#endif // wxUSE_PRINTING_ARCHITECTURE
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -339,12 +347,14 @@ void AppFrame::OnExit (wxCommandEvent &WXUNUSED(event)) {
|
|||||||
// file event handlers
|
// file event handlers
|
||||||
void AppFrame::OnFileOpen (wxCommandEvent &WXUNUSED(event)) {
|
void AppFrame::OnFileOpen (wxCommandEvent &WXUNUSED(event)) {
|
||||||
if (!m_edit) return;
|
if (!m_edit) return;
|
||||||
|
#if wxUSE_FILEDLG
|
||||||
wxString fname;
|
wxString fname;
|
||||||
wxFileDialog dlg (this, _T("Open file"), _T(""), _T(""), _T("Any file (*)|*"),
|
wxFileDialog dlg (this, _T("Open file"), wxEmptyString, wxEmptyString, _T("Any file (*)|*"),
|
||||||
wxOPEN | wxFILE_MUST_EXIST | wxCHANGE_DIR);
|
wxOPEN | wxFILE_MUST_EXIST | wxCHANGE_DIR);
|
||||||
if (dlg.ShowModal() != wxID_OK) return;
|
if (dlg.ShowModal() != wxID_OK) return;
|
||||||
fname = dlg.GetPath ();
|
fname = dlg.GetPath ();
|
||||||
FileOpen (fname);
|
FileOpen (fname);
|
||||||
|
#endif // wxUSE_FILEDLG
|
||||||
}
|
}
|
||||||
|
|
||||||
void AppFrame::OnFileSave (wxCommandEvent &WXUNUSED(event)) {
|
void AppFrame::OnFileSave (wxCommandEvent &WXUNUSED(event)) {
|
||||||
@@ -359,11 +369,13 @@ void AppFrame::OnFileSave (wxCommandEvent &WXUNUSED(event)) {
|
|||||||
|
|
||||||
void AppFrame::OnFileSaveAs (wxCommandEvent &WXUNUSED(event)) {
|
void AppFrame::OnFileSaveAs (wxCommandEvent &WXUNUSED(event)) {
|
||||||
if (!m_edit) return;
|
if (!m_edit) return;
|
||||||
|
#if wxUSE_FILEDLG
|
||||||
wxString filename = wxEmptyString;
|
wxString filename = wxEmptyString;
|
||||||
wxFileDialog dlg (this, _T("Save file"), _T(""), _T(""), _T("Any file (*)|*"), wxSAVE|wxOVERWRITE_PROMPT);
|
wxFileDialog dlg (this, _T("Save file"), wxEmptyString, wxEmptyString, _T("Any file (*)|*"), wxSAVE|wxOVERWRITE_PROMPT);
|
||||||
if (dlg.ShowModal() != wxID_OK) return;
|
if (dlg.ShowModal() != wxID_OK) return;
|
||||||
filename = dlg.GetPath();
|
filename = dlg.GetPath();
|
||||||
m_edit->SaveFile (filename);
|
m_edit->SaveFile (filename);
|
||||||
|
#endif // wxUSE_FILEDLG
|
||||||
}
|
}
|
||||||
|
|
||||||
void AppFrame::OnFileClose (wxCommandEvent &WXUNUSED(event)) {
|
void AppFrame::OnFileClose (wxCommandEvent &WXUNUSED(event)) {
|
||||||
@@ -392,14 +404,17 @@ void AppFrame::OnProperties (wxCommandEvent &WXUNUSED(event)) {
|
|||||||
|
|
||||||
// print event handlers
|
// print event handlers
|
||||||
void AppFrame::OnPrintSetup (wxCommandEvent &WXUNUSED(event)) {
|
void AppFrame::OnPrintSetup (wxCommandEvent &WXUNUSED(event)) {
|
||||||
|
#if wxUSE_PRINTING_ARCHITECTURE
|
||||||
(*g_pageSetupData) = * g_printData;
|
(*g_pageSetupData) = * g_printData;
|
||||||
wxPageSetupDialog pageSetupDialog(this, g_pageSetupData);
|
wxPageSetupDialog pageSetupDialog(this, g_pageSetupData);
|
||||||
pageSetupDialog.ShowModal();
|
pageSetupDialog.ShowModal();
|
||||||
(*g_printData) = pageSetupDialog.GetPageSetupData().GetPrintData();
|
(*g_printData) = pageSetupDialog.GetPageSetupData().GetPrintData();
|
||||||
(*g_pageSetupData) = pageSetupDialog.GetPageSetupData();
|
(*g_pageSetupData) = pageSetupDialog.GetPageSetupData();
|
||||||
|
#endif // wxUSE_PRINTING_ARCHITECTURE
|
||||||
}
|
}
|
||||||
|
|
||||||
void AppFrame::OnPrintPreview (wxCommandEvent &WXUNUSED(event)) {
|
void AppFrame::OnPrintPreview (wxCommandEvent &WXUNUSED(event)) {
|
||||||
|
#if wxUSE_PRINTING_ARCHITECTURE
|
||||||
wxPrintDialogData printDialogData( *g_printData);
|
wxPrintDialogData printDialogData( *g_printData);
|
||||||
wxPrintPreview *preview =
|
wxPrintPreview *preview =
|
||||||
new wxPrintPreview (new EditPrint (m_edit),
|
new wxPrintPreview (new EditPrint (m_edit),
|
||||||
@@ -418,9 +433,11 @@ void AppFrame::OnPrintPreview (wxCommandEvent &WXUNUSED(event)) {
|
|||||||
frame->Centre(wxBOTH);
|
frame->Centre(wxBOTH);
|
||||||
frame->Initialize();
|
frame->Initialize();
|
||||||
frame->Show(true);
|
frame->Show(true);
|
||||||
|
#endif // wxUSE_PRINTING_ARCHITECTURE
|
||||||
}
|
}
|
||||||
|
|
||||||
void AppFrame::OnPrint (wxCommandEvent &WXUNUSED(event)) {
|
void AppFrame::OnPrint (wxCommandEvent &WXUNUSED(event)) {
|
||||||
|
#if wxUSE_PRINTING_ARCHITECTURE
|
||||||
wxPrintDialogData printDialogData( *g_printData);
|
wxPrintDialogData printDialogData( *g_printData);
|
||||||
wxPrinter printer (&printDialogData);
|
wxPrinter printer (&printDialogData);
|
||||||
EditPrint printout (m_edit);
|
EditPrint printout (m_edit);
|
||||||
@@ -433,6 +450,7 @@ void AppFrame::OnPrint (wxCommandEvent &WXUNUSED(event)) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
(*g_printData) = printer.GetPrintDialogData().GetPrintData();
|
(*g_printData) = printer.GetPrintDialogData().GetPrintData();
|
||||||
|
#endif // wxUSE_PRINTING_ARCHITECTURE
|
||||||
}
|
}
|
||||||
|
|
||||||
// edit events
|
// edit events
|
||||||
@@ -441,8 +459,8 @@ void AppFrame::OnEdit (wxCommandEvent &event) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// private functions
|
// private functions
|
||||||
void AppFrame::CreateMenu () {
|
void AppFrame::CreateMenu ()
|
||||||
|
{
|
||||||
// File menu
|
// File menu
|
||||||
wxMenu *menuFile = new wxMenu;
|
wxMenu *menuFile = new wxMenu;
|
||||||
menuFile->Append (wxID_OPEN, _("&Open ..\tCtrl+O"));
|
menuFile->Append (wxID_OPEN, _("&Open ..\tCtrl+O"));
|
||||||
@@ -552,10 +570,10 @@ void AppFrame::CreateMenu () {
|
|||||||
m_menuBar->Append (menuWindow, _("&Window"));
|
m_menuBar->Append (menuWindow, _("&Window"));
|
||||||
m_menuBar->Append (menuHelp, _("&Help"));
|
m_menuBar->Append (menuHelp, _("&Help"));
|
||||||
SetMenuBar (m_menuBar);
|
SetMenuBar (m_menuBar);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void AppFrame::FileOpen (wxString fname) {
|
void AppFrame::FileOpen (wxString fname)
|
||||||
|
{
|
||||||
wxFileName w(fname); w.Normalize(); fname = w.GetFullPath();
|
wxFileName w(fname); w.Normalize(); fname = w.GetFullPath();
|
||||||
m_edit->LoadFile (fname);
|
m_edit->LoadFile (fname);
|
||||||
}
|
}
|
||||||
@@ -661,4 +679,3 @@ void AppAbout::OnTimerEvent (wxTimerEvent &WXUNUSED(event)) {
|
|||||||
m_timer = NULL;
|
m_timer = NULL;
|
||||||
EndModal (wxID_OK);
|
EndModal (wxID_OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -187,7 +187,7 @@ bool MyApp::OnInit()
|
|||||||
|
|
||||||
SetTopWindow(frame);
|
SetTopWindow(frame);
|
||||||
|
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -298,7 +298,7 @@ void MyFrame::OnNewWindow(wxCommandEvent& WXUNUSED(event) )
|
|||||||
// Associate the menu bar with the frame
|
// Associate the menu bar with the frame
|
||||||
subframe->SetMenuBar(menu_bar);
|
subframe->SetMenuBar(menu_bar);
|
||||||
|
|
||||||
subframe->Show(TRUE);
|
subframe->Show(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -324,12 +324,12 @@ void MyFrame::InitToolBar(wxToolBar* toolBar)
|
|||||||
int width = 16;
|
int width = 16;
|
||||||
int currentX = 5;
|
int currentX = 5;
|
||||||
|
|
||||||
toolBar->AddTool( MDI_NEW_WINDOW, *(bitmaps[0]), wxNullBitmap, FALSE, currentX, -1, (wxObject *) NULL, wxT("New SVG test window"));
|
toolBar->AddTool( MDI_NEW_WINDOW, *(bitmaps[0]), wxNullBitmap, false, currentX, wxDefaultCoord, (wxObject *) NULL, wxT("New SVG test window"));
|
||||||
currentX += width + 5;
|
currentX += width + 5;
|
||||||
toolBar->AddTool( MDI_SAVE, *bitmaps[1], wxNullBitmap, FALSE, currentX, -1, (wxObject *) NULL, wxT("Save test in SVG format"));
|
toolBar->AddTool( MDI_SAVE, *bitmaps[1], wxNullBitmap, false, currentX, wxDefaultCoord, (wxObject *) NULL, wxT("Save test in SVG format"));
|
||||||
currentX += width + 5;
|
currentX += width + 5;
|
||||||
toolBar->AddSeparator();
|
toolBar->AddSeparator();
|
||||||
toolBar->AddTool(MDI_ABOUT, *bitmaps[2], wxNullBitmap, FALSE, currentX, -1, (wxObject *) NULL, wxT("Help"));
|
toolBar->AddTool(MDI_ABOUT, *bitmaps[2], wxNullBitmap, false, currentX, wxDefaultCoord, (wxObject *) NULL, wxT("Help"));
|
||||||
|
|
||||||
toolBar->Realize();
|
toolBar->Realize();
|
||||||
|
|
||||||
@@ -341,6 +341,7 @@ void MyFrame::InitToolBar(wxToolBar* toolBar)
|
|||||||
|
|
||||||
void MyFrame::FileSavePicture (wxCommandEvent & WXUNUSED(event) )
|
void MyFrame::FileSavePicture (wxCommandEvent & WXUNUSED(event) )
|
||||||
{
|
{
|
||||||
|
#if wxUSE_FILEDLG
|
||||||
MyChild * pChild = (MyChild *)GetActiveChild ();
|
MyChild * pChild = (MyChild *)GetActiveChild ();
|
||||||
if (pChild == NULL)
|
if (pChild == NULL)
|
||||||
{
|
{
|
||||||
@@ -359,6 +360,7 @@ void MyFrame::FileSavePicture (wxCommandEvent & WXUNUSED(event) )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
return ;
|
return ;
|
||||||
|
#endif // wxUSE_FILEDLG
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -464,7 +466,7 @@ void MyCanvas::OnDraw(wxDC& dc)
|
|||||||
dc.DrawText(wxT("This is a Red string"), 50, 200);
|
dc.DrawText(wxT("This is a Red string"), 50, 200);
|
||||||
dc.DrawRotatedText(wxT("This is a 45 deg string"), 50, 200, 45);
|
dc.DrawRotatedText(wxT("This is a 45 deg string"), 50, 200, 45);
|
||||||
dc.DrawRotatedText(wxT("This is a 90 deg string"), 50, 200, 90);
|
dc.DrawRotatedText(wxT("This is a 90 deg string"), 50, 200, 90);
|
||||||
wF = wxFont ( 18, wxROMAN, wxITALIC, wxBOLD, FALSE, wxT("Times New Roman"));
|
wF = wxFont ( 18, wxROMAN, wxITALIC, wxBOLD, false, wxT("Times New Roman"));
|
||||||
dc.SetFont(wF);
|
dc.SetFont(wF);
|
||||||
dc.SetTextForeground (wC) ;
|
dc.SetTextForeground (wC) ;
|
||||||
dc.DrawText(wxT("This is a Times-style string"), 50, 60);
|
dc.DrawText(wxT("This is a Times-style string"), 50, 60);
|
||||||
@@ -520,7 +522,7 @@ void MyCanvas::OnDraw(wxDC& dc)
|
|||||||
break ;
|
break ;
|
||||||
|
|
||||||
case 5:
|
case 5:
|
||||||
wF = wxFont ( 18, wxROMAN, wxITALIC, wxBOLD, FALSE, wxT("Times New Roman"));
|
wF = wxFont ( 18, wxROMAN, wxITALIC, wxBOLD, false, wxT("Times New Roman"));
|
||||||
dc.SetFont(wF);
|
dc.SetFont(wF);
|
||||||
dc.DrawLine(0, 0, 200, 200);
|
dc.DrawLine(0, 0, 200, 200);
|
||||||
dc.DrawLine(200, 0, 0, 200);
|
dc.DrawLine(200, 0, 0, 200);
|
||||||
@@ -601,7 +603,7 @@ MyChild::~MyChild()
|
|||||||
|
|
||||||
void MyChild::OnQuit(wxCommandEvent& WXUNUSED(event))
|
void MyChild::OnQuit(wxCommandEvent& WXUNUSED(event))
|
||||||
{
|
{
|
||||||
Close(TRUE);
|
Close(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -154,6 +154,7 @@ END_EVENT_TABLE()
|
|||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
|
|
||||||
|
#if wxUSE_DATAOBJ
|
||||||
static wxTextFileType wxConvertEOLMode(int scintillaMode)
|
static wxTextFileType wxConvertEOLMode(int scintillaMode)
|
||||||
{
|
{
|
||||||
wxTextFileType type;
|
wxTextFileType type;
|
||||||
@@ -177,6 +178,7 @@ static wxTextFileType wxConvertEOLMode(int scintillaMode)
|
|||||||
}
|
}
|
||||||
return type;
|
return type;
|
||||||
}
|
}
|
||||||
|
#endif // wxUSE_DATAOBJ
|
||||||
|
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
@@ -439,6 +441,7 @@ void ScintillaWX::Paste() {
|
|||||||
pdoc->BeginUndoAction();
|
pdoc->BeginUndoAction();
|
||||||
ClearSelection();
|
ClearSelection();
|
||||||
|
|
||||||
|
#if wxUSE_DATAOBJ
|
||||||
wxTextDataObject data;
|
wxTextDataObject data;
|
||||||
bool gotData = false;
|
bool gotData = false;
|
||||||
|
|
||||||
@@ -455,6 +458,7 @@ void ScintillaWX::Paste() {
|
|||||||
pdoc->InsertString(currentPos, buf, len);
|
pdoc->InsertString(currentPos, buf, len);
|
||||||
SetEmptySelection(currentPos + len);
|
SetEmptySelection(currentPos + len);
|
||||||
}
|
}
|
||||||
|
#endif // wxUSE_DATAOBJ
|
||||||
|
|
||||||
pdoc->EndUndoAction();
|
pdoc->EndUndoAction();
|
||||||
NotifyChange();
|
NotifyChange();
|
||||||
@@ -463,16 +467,21 @@ void ScintillaWX::Paste() {
|
|||||||
|
|
||||||
|
|
||||||
void ScintillaWX::CopyToClipboard(const SelectionText& st) {
|
void ScintillaWX::CopyToClipboard(const SelectionText& st) {
|
||||||
|
#if wxUSE_CLIPBOARD
|
||||||
if (wxTheClipboard->Open()) {
|
if (wxTheClipboard->Open()) {
|
||||||
wxTheClipboard->UsePrimarySelection(false);
|
wxTheClipboard->UsePrimarySelection(false);
|
||||||
wxString text = wxTextBuffer::Translate(stc2wx(st.s, st.len-1));
|
wxString text = wxTextBuffer::Translate(stc2wx(st.s, st.len-1));
|
||||||
wxTheClipboard->SetData(new wxTextDataObject(text));
|
wxTheClipboard->SetData(new wxTextDataObject(text));
|
||||||
wxTheClipboard->Close();
|
wxTheClipboard->Close();
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
wxUnusedVar(st);
|
||||||
|
#endif // wxUSE_CLIPBOARD
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool ScintillaWX::CanPaste() {
|
bool ScintillaWX::CanPaste() {
|
||||||
|
#if wxUSE_CLIPBOARD
|
||||||
bool canPaste = false;
|
bool canPaste = false;
|
||||||
bool didOpen;
|
bool didOpen;
|
||||||
|
|
||||||
@@ -489,6 +498,9 @@ bool ScintillaWX::CanPaste() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
return canPaste;
|
return canPaste;
|
||||||
|
#else
|
||||||
|
return false;
|
||||||
|
#endif // wxUSE_CLIPBOARD
|
||||||
}
|
}
|
||||||
|
|
||||||
void ScintillaWX::CreateCallTipWindow(PRectangle) {
|
void ScintillaWX::CreateCallTipWindow(PRectangle) {
|
||||||
|
Reference in New Issue
Block a user