Patch level : 4.0
Files correlati : xvaga Ricompilazione Demo : [ ] Commento : Aggiunto supporto per i docking panes git-svn-id: svn://10.65.10.50/trunk@15997 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
9565e5b41a
commit
d1cf5a4278
@ -332,7 +332,7 @@ void xvt_app_create(int argc, char **argv, unsigned long flags,
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
_task_win = new TTaskWin(NULL, ICON_RSRC, title, pos, size, style);
|
_task_win = new TTaskWin(ICON_RSRC, title, pos, size, style);
|
||||||
_task_win->SetBackgroundStyle(wxBG_STYLE_CUSTOM); // Lo sfondo viene disegnato nella OnPaint
|
_task_win->SetBackgroundStyle(wxBG_STYLE_CUSTOM); // Lo sfondo viene disegnato nella OnPaint
|
||||||
|
|
||||||
_nice_windows.Put((WINDOW)_task_win, _task_win);
|
_nice_windows.Put((WINDOW)_task_win, _task_win);
|
||||||
@ -1962,9 +1962,10 @@ BOOLEAN xvt_fsys_convert_fspec_to_str(const FILE_SPEC *fs, char *path, int sz_pa
|
|||||||
BOOLEAN ok = FALSE;
|
BOOLEAN ok = FALSE;
|
||||||
if (fs != NULL)
|
if (fs != NULL)
|
||||||
{
|
{
|
||||||
char mbs[256];
|
char mbs[_MAX_PATH];
|
||||||
xvt_fsys_build_pathname(mbs, "", fs->dir.path, fs->name, fs->type, NULL);
|
xvt_fsys_build_pathname(mbs, "", fs->dir.path, fs->name, fs->type, NULL);
|
||||||
wxStrncpy(path, mbs, sz_path);
|
wxStrncpy(path, mbs, sz_path);
|
||||||
|
ok = *path > ' ';
|
||||||
}
|
}
|
||||||
return ok;
|
return ok;
|
||||||
}
|
}
|
||||||
@ -1974,11 +1975,11 @@ BOOLEAN xvt_fsys_convert_str_to_fspec(const char *mbs, FILE_SPEC *fs)
|
|||||||
BOOLEAN ok = FALSE;
|
BOOLEAN ok = FALSE;
|
||||||
if (mbs && *mbs && fs != NULL)
|
if (mbs && *mbs && fs != NULL)
|
||||||
{
|
{
|
||||||
|
memset(fs, 0, sizeof(FILE_SPEC));
|
||||||
char volume[_MAX_DRIVE], path[_MAX_PATH];
|
char volume[_MAX_DRIVE], path[_MAX_PATH];
|
||||||
xvt_fsys_parse_pathname(mbs, volume, path, fs->name, fs->type, NULL);
|
xvt_fsys_parse_pathname(mbs, volume, path, fs->name, fs->type, NULL);
|
||||||
wxStrcpy(fs->dir.path, volume);
|
wxStrcpy(fs->dir.path, volume);
|
||||||
wxStrcat(fs->dir.path, path);
|
wxStrcat(fs->dir.path, path);
|
||||||
|
|
||||||
wxStrcpy(fs->creator, "CAMPO");
|
wxStrcpy(fs->creator, "CAMPO");
|
||||||
ok = fs->name[0] != '\0';
|
ok = fs->name[0] != '\0';
|
||||||
}
|
}
|
||||||
|
@ -17,19 +17,15 @@ class TMainApp : public wxApp
|
|||||||
protected:
|
protected:
|
||||||
virtual bool OnInit();
|
virtual bool OnInit();
|
||||||
virtual int OnExit();
|
virtual int OnExit();
|
||||||
|
|
||||||
|
|
||||||
virtual void OnTimer(wxTimerEvent& event);
|
virtual void OnTimer(wxTimerEvent& event);
|
||||||
|
|
||||||
DECLARE_EVENT_TABLE()
|
DECLARE_EVENT_TABLE()
|
||||||
|
|
||||||
|
|
||||||
DECLARE_DYNAMIC_CLASS(TMainApp);
|
DECLARE_DYNAMIC_CLASS(TMainApp);
|
||||||
};
|
};
|
||||||
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(TMainApp, wxApp)
|
IMPLEMENT_DYNAMIC_CLASS(TMainApp, wxApp)
|
||||||
|
|
||||||
DECLARE_APP(TMainApp)
|
DECLARE_APP(TMainApp)
|
||||||
|
|
||||||
IMPLEMENT_APP(TMainApp)
|
IMPLEMENT_APP(TMainApp)
|
||||||
|
|
||||||
|
|
||||||
@ -44,8 +40,6 @@ void TMainApp::OnTimer(wxTimerEvent& event)
|
|||||||
xvt_main(argc, argv);
|
xvt_main(argc, argv);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
bool TMainApp::OnInit()
|
bool TMainApp::OnInit()
|
||||||
{
|
{
|
||||||
#if wxCHECK_VERSION(2,8,3)
|
#if wxCHECK_VERSION(2,8,3)
|
||||||
|
@ -403,6 +403,8 @@ XVTDLL void xvt_win_set_handler(WINDOW win, EVENT_HANDLER eh);
|
|||||||
XVTDLL void xvt_win_trap_pointer(WINDOW win);
|
XVTDLL void xvt_win_trap_pointer(WINDOW win);
|
||||||
|
|
||||||
// Added by XVAGA
|
// Added by XVAGA
|
||||||
|
XVTDLL BOOLEAN xvt_win_add_pane(WINDOW win, WINDOW pane, const char* name, int dock, int flags);
|
||||||
|
|
||||||
typedef int ODBC_CALLBACK(void*,int,char**, char**);
|
typedef int ODBC_CALLBACK(void*,int,char**, char**);
|
||||||
XVTDLL XVT_ODBC xvt_odbc_get_connection(const char* dsn, const char* usr, const char* pwd, const char* dir);
|
XVTDLL XVT_ODBC xvt_odbc_get_connection(const char* dsn, const char* usr, const char* pwd, const char* dir);
|
||||||
XVTDLL BOOLEAN xvt_odbc_free_connection(XVT_ODBC handle);
|
XVTDLL BOOLEAN xvt_odbc_free_connection(XVT_ODBC handle);
|
||||||
|
@ -6,6 +6,7 @@
|
|||||||
|
|
||||||
#include "wx/notebook.h"
|
#include "wx/notebook.h"
|
||||||
#include "wx/treectrl.h"
|
#include "wx/treectrl.h"
|
||||||
|
#include "wx/aui/aui.h"
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////
|
||||||
// Utilities
|
// Utilities
|
||||||
@ -811,8 +812,8 @@ void TwxWindow::OnSize(wxSizeEvent& evt)
|
|||||||
{
|
{
|
||||||
EVENT e; memset(&e, 0, sizeof(EVENT));
|
EVENT e; memset(&e, 0, sizeof(EVENT));
|
||||||
e.type = E_SIZE;
|
e.type = E_SIZE;
|
||||||
e.v.size.height = evt.GetSize().x;
|
e.v.size.width = evt.GetSize().x;
|
||||||
e.v.size.width = evt.GetSize().y;
|
e.v.size.height = evt.GetSize().y;
|
||||||
DoXvtEvent(e);
|
DoXvtEvent(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -863,10 +864,52 @@ void TwxWindow::SetMenuTree(const MENU_ITEM* tree)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
BOOLEAN TwxWindow::AddPane(wxWindow* wnd, const char* caption, int nDock, int nFlags)
|
||||||
|
{
|
||||||
|
BOOLEAN ok = wnd != NULL_WIN;
|
||||||
|
if (ok)
|
||||||
|
{
|
||||||
|
if (m_pManager == NULL)
|
||||||
|
m_pManager = new wxAuiManager(this);
|
||||||
|
wxAuiPaneInfo pane;
|
||||||
|
pane.DefaultPane(); pane.Dockable(false);
|
||||||
|
if (caption && *caption)
|
||||||
|
pane.Caption(caption);
|
||||||
|
const wxSize sz = wnd->GetSize();
|
||||||
|
switch (nDock)
|
||||||
|
{
|
||||||
|
case 1:
|
||||||
|
pane.Left().LeftDockable().RightDockable().MinSize(sz.x/2, -1);
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
pane.Top().TopDockable().BottomDockable().MinSize(-1, sz.y/2);
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
pane.Right().LeftDockable().RightDockable().MinSize(sz.x/2, -1);
|
||||||
|
break;
|
||||||
|
case 4:
|
||||||
|
pane.Bottom().TopDockable().BottomDockable().MinSize(-1, sz.y/2);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
pane.CentrePane().Floatable(false);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
ok = m_pManager->AddPane(wnd, pane);
|
||||||
|
if (ok)
|
||||||
|
m_pManager->Update();
|
||||||
|
}
|
||||||
|
return ok;
|
||||||
|
}
|
||||||
|
|
||||||
|
TwxWindow::TwxWindow()
|
||||||
|
: m_menu(NULL), _type(W_DOC), _eh(NULL), _app_data(0L),
|
||||||
|
_timer(NULL), m_pManager(NULL)
|
||||||
|
{ }
|
||||||
|
|
||||||
TwxWindow::TwxWindow(wxWindow *parent, wxWindowID id, const wxString& title,
|
TwxWindow::TwxWindow(wxWindow *parent, wxWindowID id, const wxString& title,
|
||||||
const wxPoint& pos, const wxSize& size, long style)
|
const wxPoint& pos, const wxSize& size, long style)
|
||||||
: TwxWindowBase(parent, id, title, pos, size, style),
|
: TwxWindowBase(parent, id, title, pos, size, style),
|
||||||
m_menu(NULL), _eh(NULL), _timer(NULL)
|
m_menu(NULL), _eh(NULL), _timer(NULL), m_pManager(NULL)
|
||||||
{
|
{
|
||||||
_nice_windows.Put((WINDOW)this, this);
|
_nice_windows.Put((WINDOW)this, this);
|
||||||
}
|
}
|
||||||
@ -875,6 +918,13 @@ TwxWindow::~TwxWindow()
|
|||||||
{
|
{
|
||||||
if (_timer)
|
if (_timer)
|
||||||
delete _timer;
|
delete _timer;
|
||||||
|
|
||||||
|
if (m_pManager)
|
||||||
|
{
|
||||||
|
m_pManager->UnInit(); // Obbligatorio ma, chissa' perche', non gestito dal distruttore!
|
||||||
|
delete m_pManager;
|
||||||
|
}
|
||||||
|
|
||||||
if (m_menu)
|
if (m_menu)
|
||||||
{
|
{
|
||||||
xvt_res_free_menu_tree(m_menu);
|
xvt_res_free_menu_tree(m_menu);
|
||||||
@ -946,8 +996,8 @@ void TTaskWin::OnSize(wxSizeEvent& evt)
|
|||||||
{
|
{
|
||||||
EVENT e; memset(&e, 0, sizeof(EVENT));
|
EVENT e; memset(&e, 0, sizeof(EVENT));
|
||||||
e.type = E_SIZE;
|
e.type = E_SIZE;
|
||||||
e.v.size.height = evt.GetSize().x;
|
e.v.size.width = evt.GetSize().x;
|
||||||
e.v.size.width = evt.GetSize().y;
|
e.v.size.height = evt.GetSize().y;
|
||||||
_task_win_handler((WINDOW)this, &e);
|
_task_win_handler((WINDOW)this, &e);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1021,10 +1071,10 @@ void TTaskWin::PopMenuTree()
|
|||||||
m_MenuOwner = NULL; // = this;
|
m_MenuOwner = NULL; // = this;
|
||||||
}
|
}
|
||||||
|
|
||||||
TTaskWin::TTaskWin(wxWindow *parent, wxWindowID id,
|
TTaskWin::TTaskWin(wxWindowID id,
|
||||||
const wxString& title, const wxPoint& pos,
|
const wxString& title, const wxPoint& pos,
|
||||||
const wxSize& size, long style)
|
const wxSize& size, long style)
|
||||||
: wxFrame(parent, id, title, pos, size, style), m_menu(NULL), m_pOldBar(NULL), m_MenuOwner(NULL)
|
: wxFrame(NULL, id, title, pos, size, style), m_menu(NULL), m_pOldBar(NULL), m_MenuOwner(NULL)
|
||||||
{
|
{
|
||||||
wxIcon* ico = _GetIconResource(ICON_RSRC);
|
wxIcon* ico = _GetIconResource(ICON_RSRC);
|
||||||
if (ico)
|
if (ico)
|
||||||
@ -1205,6 +1255,20 @@ void xvt_ctl_set_checked(WINDOW win, BOOLEAN bCheck)
|
|||||||
cb->SetValue(bCheck != 0);
|
cb->SetValue(bCheck != 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
///////////////////////////////////////////////////////////
|
||||||
|
// Pane interface
|
||||||
|
///////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
BOOLEAN xvt_win_add_pane(WINDOW win, WINDOW pane, const char* name, int dock, int flags)
|
||||||
|
{
|
||||||
|
BOOLEAN done = FALSE;
|
||||||
|
if (win != NULL_WIN && pane != NULL_WIN && name && *name)
|
||||||
|
{
|
||||||
|
done = ((TwxWindow*)win)->AddPane((wxWindow*)pane, name, dock, flags);
|
||||||
|
}
|
||||||
|
return done;
|
||||||
|
}
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////
|
||||||
// Notebook interface
|
// Notebook interface
|
||||||
///////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////
|
||||||
|
@ -128,10 +128,13 @@ public:
|
|||||||
DECLARE_DYNAMIC_CLASS(TwxWindowBase)
|
DECLARE_DYNAMIC_CLASS(TwxWindowBase)
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class wxAuiManager;
|
||||||
|
|
||||||
class TwxWindow : public TwxWindowBase
|
class TwxWindow : public TwxWindowBase
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
MENU_ITEM* m_menu;
|
MENU_ITEM* m_menu;
|
||||||
|
wxAuiManager* m_pManager;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void OnChar(wxKeyEvent& e);
|
virtual void OnChar(wxKeyEvent& e);
|
||||||
@ -169,7 +172,9 @@ public:
|
|||||||
void SetMenuTree(const MENU_ITEM* menu);
|
void SetMenuTree(const MENU_ITEM* menu);
|
||||||
MENU_ITEM* GetMenuTree() const { return m_menu; }
|
MENU_ITEM* GetMenuTree() const { return m_menu; }
|
||||||
|
|
||||||
TwxWindow() : m_menu(NULL), _type(W_DOC), _eh(NULL), _app_data(0L), _timer(NULL) { }
|
BOOLEAN AddPane(wxWindow* wnd, const char* name, int nDock = 0, int nFlags = 0);
|
||||||
|
|
||||||
|
TwxWindow();
|
||||||
TwxWindow(wxWindow *parent, wxWindowID id, const wxString& title,
|
TwxWindow(wxWindow *parent, wxWindowID id, const wxString& title,
|
||||||
const wxPoint& pos = wxDefaultPosition,
|
const wxPoint& pos = wxDefaultPosition,
|
||||||
const wxSize& size = wxDefaultSize, long style = 0);
|
const wxSize& size = wxDefaultSize, long style = 0);
|
||||||
@ -193,6 +198,8 @@ protected:
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
virtual void OnPaint(wxPaintEvent& e);
|
virtual void OnPaint(wxPaintEvent& e);
|
||||||
|
DECLARE_DYNAMIC_CLASS(TTaskWin);
|
||||||
|
DECLARE_EVENT_TABLE();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
void SetMenuTree(const MENU_ITEM* tree);
|
void SetMenuTree(const MENU_ITEM* tree);
|
||||||
@ -200,14 +207,11 @@ public:
|
|||||||
void PushMenuTree(const MENU_ITEM* tree, wxWindow* owner);
|
void PushMenuTree(const MENU_ITEM* tree, wxWindow* owner);
|
||||||
void PopMenuTree();
|
void PopMenuTree();
|
||||||
|
|
||||||
TTaskWin() : wxFrame(), m_menu(NULL), m_pOldBar(NULL) { }
|
TTaskWin() : wxFrame(), m_menu(NULL), m_pOldBar(NULL) { } // Needed by DECLARE_DYNAMIC_CLASS
|
||||||
TTaskWin(wxWindow *parent, wxWindowID id, const wxString& title,
|
TTaskWin(wxWindowID id, const wxString& title,
|
||||||
const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
|
const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
|
||||||
long style = wxDEFAULT_FRAME_STYLE);
|
long style = wxDEFAULT_FRAME_STYLE);
|
||||||
~TTaskWin();
|
virtual ~TTaskWin();
|
||||||
|
|
||||||
DECLARE_DYNAMIC_CLASS(TTaskWin);
|
|
||||||
DECLARE_EVENT_TABLE();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#define TIMER_ID 1
|
#define TIMER_ID 1
|
||||||
|
Loading…
x
Reference in New Issue
Block a user