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
|
||||
}
|
||||
|
||||
_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
|
||||
|
||||
_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;
|
||||
if (fs != NULL)
|
||||
{
|
||||
char mbs[256];
|
||||
char mbs[_MAX_PATH];
|
||||
xvt_fsys_build_pathname(mbs, "", fs->dir.path, fs->name, fs->type, NULL);
|
||||
wxStrncpy(path, mbs, sz_path);
|
||||
ok = *path > ' ';
|
||||
}
|
||||
return ok;
|
||||
}
|
||||
@ -1974,11 +1975,11 @@ BOOLEAN xvt_fsys_convert_str_to_fspec(const char *mbs, FILE_SPEC *fs)
|
||||
BOOLEAN ok = FALSE;
|
||||
if (mbs && *mbs && fs != NULL)
|
||||
{
|
||||
memset(fs, 0, sizeof(FILE_SPEC));
|
||||
char volume[_MAX_DRIVE], path[_MAX_PATH];
|
||||
xvt_fsys_parse_pathname(mbs, volume, path, fs->name, fs->type, NULL);
|
||||
wxStrcpy(fs->dir.path, volume);
|
||||
wxStrcat(fs->dir.path, path);
|
||||
|
||||
wxStrcpy(fs->creator, "CAMPO");
|
||||
ok = fs->name[0] != '\0';
|
||||
}
|
||||
|
@ -17,19 +17,15 @@ class TMainApp : public wxApp
|
||||
protected:
|
||||
virtual bool OnInit();
|
||||
virtual int OnExit();
|
||||
|
||||
|
||||
virtual void OnTimer(wxTimerEvent& event);
|
||||
|
||||
DECLARE_EVENT_TABLE()
|
||||
|
||||
|
||||
DECLARE_DYNAMIC_CLASS(TMainApp);
|
||||
};
|
||||
|
||||
IMPLEMENT_DYNAMIC_CLASS(TMainApp, wxApp)
|
||||
|
||||
DECLARE_APP(TMainApp)
|
||||
|
||||
IMPLEMENT_APP(TMainApp)
|
||||
|
||||
|
||||
@ -44,8 +40,6 @@ void TMainApp::OnTimer(wxTimerEvent& event)
|
||||
xvt_main(argc, argv);
|
||||
}
|
||||
|
||||
|
||||
|
||||
bool TMainApp::OnInit()
|
||||
{
|
||||
#if wxCHECK_VERSION(2,8,3)
|
||||
@ -67,4 +61,4 @@ int TMainApp::OnExit()
|
||||
m_sic = NULL;
|
||||
#endif
|
||||
return wxApp::OnExit();
|
||||
}
|
||||
}
|
||||
|
@ -403,6 +403,8 @@ XVTDLL void xvt_win_set_handler(WINDOW win, EVENT_HANDLER eh);
|
||||
XVTDLL void xvt_win_trap_pointer(WINDOW win);
|
||||
|
||||
// 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**);
|
||||
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);
|
||||
|
@ -6,6 +6,7 @@
|
||||
|
||||
#include "wx/notebook.h"
|
||||
#include "wx/treectrl.h"
|
||||
#include "wx/aui/aui.h"
|
||||
|
||||
///////////////////////////////////////////////////////////
|
||||
// Utilities
|
||||
@ -811,8 +812,8 @@ void TwxWindow::OnSize(wxSizeEvent& evt)
|
||||
{
|
||||
EVENT e; memset(&e, 0, sizeof(EVENT));
|
||||
e.type = E_SIZE;
|
||||
e.v.size.height = evt.GetSize().x;
|
||||
e.v.size.width = evt.GetSize().y;
|
||||
e.v.size.width = evt.GetSize().x;
|
||||
e.v.size.height = evt.GetSize().y;
|
||||
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,
|
||||
const wxPoint& pos, const wxSize& size, long 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);
|
||||
}
|
||||
@ -875,6 +918,13 @@ TwxWindow::~TwxWindow()
|
||||
{
|
||||
if (_timer)
|
||||
delete _timer;
|
||||
|
||||
if (m_pManager)
|
||||
{
|
||||
m_pManager->UnInit(); // Obbligatorio ma, chissa' perche', non gestito dal distruttore!
|
||||
delete m_pManager;
|
||||
}
|
||||
|
||||
if (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));
|
||||
e.type = E_SIZE;
|
||||
e.v.size.height = evt.GetSize().x;
|
||||
e.v.size.width = evt.GetSize().y;
|
||||
e.v.size.width = evt.GetSize().x;
|
||||
e.v.size.height = evt.GetSize().y;
|
||||
_task_win_handler((WINDOW)this, &e);
|
||||
}
|
||||
|
||||
@ -1021,10 +1071,10 @@ void TTaskWin::PopMenuTree()
|
||||
m_MenuOwner = NULL; // = this;
|
||||
}
|
||||
|
||||
TTaskWin::TTaskWin(wxWindow *parent, wxWindowID id,
|
||||
TTaskWin::TTaskWin(wxWindowID id,
|
||||
const wxString& title, const wxPoint& pos,
|
||||
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);
|
||||
if (ico)
|
||||
@ -1205,6 +1255,20 @@ void xvt_ctl_set_checked(WINDOW win, BOOLEAN bCheck)
|
||||
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
|
||||
///////////////////////////////////////////////////////////
|
||||
|
@ -128,10 +128,13 @@ public:
|
||||
DECLARE_DYNAMIC_CLASS(TwxWindowBase)
|
||||
};
|
||||
|
||||
class wxAuiManager;
|
||||
|
||||
class TwxWindow : public TwxWindowBase
|
||||
{
|
||||
private:
|
||||
MENU_ITEM* m_menu;
|
||||
wxAuiManager* m_pManager;
|
||||
|
||||
protected:
|
||||
virtual void OnChar(wxKeyEvent& e);
|
||||
@ -169,7 +172,9 @@ public:
|
||||
void SetMenuTree(const MENU_ITEM* 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,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize, long style = 0);
|
||||
@ -193,21 +198,20 @@ protected:
|
||||
|
||||
public:
|
||||
virtual void OnPaint(wxPaintEvent& e);
|
||||
DECLARE_DYNAMIC_CLASS(TTaskWin);
|
||||
DECLARE_EVENT_TABLE();
|
||||
|
||||
public:
|
||||
void SetMenuTree(const MENU_ITEM* tree);
|
||||
const MENU_ITEM* GetMenuTree() const { return m_menu; }
|
||||
void PushMenuTree(const MENU_ITEM* tree, wxWindow* owner);
|
||||
void PopMenuTree();
|
||||
|
||||
TTaskWin() : wxFrame(), m_menu(NULL), m_pOldBar(NULL) { }
|
||||
TTaskWin(wxWindow *parent, wxWindowID id, const wxString& title,
|
||||
|
||||
TTaskWin() : wxFrame(), m_menu(NULL), m_pOldBar(NULL) { } // Needed by DECLARE_DYNAMIC_CLASS
|
||||
TTaskWin(wxWindowID id, const wxString& title,
|
||||
const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
|
||||
long style = wxDEFAULT_FRAME_STYLE);
|
||||
~TTaskWin();
|
||||
|
||||
DECLARE_DYNAMIC_CLASS(TTaskWin);
|
||||
DECLARE_EVENT_TABLE();
|
||||
virtual ~TTaskWin();
|
||||
};
|
||||
|
||||
#define TIMER_ID 1
|
||||
|
Loading…
x
Reference in New Issue
Block a user