Patch level :4.0 / 10.0
Files correlati : Ricompilazione Demo : [ ] Commento :eliminate wxCheckVersion git-svn-id: svn://10.65.10.50/trunk@16405 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
4b98b0a220
commit
de1978a634
@ -864,11 +864,7 @@ BOOLEAN xvt_dm_post_font_sel(WINDOW win, XVT_FNTID font_id, PRINT_RCD *precp, un
|
||||
wxFontData data;
|
||||
data.SetInitialFont(font.Font(NULL, win));
|
||||
data.EnableEffects(reserved != 0);
|
||||
#if wxCHECK_VERSION(2,8,7)
|
||||
wxFontDialog dlg(_task_win, data);
|
||||
#else
|
||||
wxFontDialog dlg(_task_win, &data);
|
||||
#endif
|
||||
BOOLEAN ok = dlg.ShowModal() == wxID_OK;
|
||||
if (ok)
|
||||
{
|
||||
@ -1217,18 +1213,11 @@ void xvt_dwin_draw_gradient_circular(WINDOW win, const RCT* r, COLOR col1, COLOR
|
||||
const wxRect rect = NormalizeRCT(r);
|
||||
CAST_COLOR(col1, color1);
|
||||
CAST_COLOR(col2, color2);
|
||||
#if wxCHECK_VERSION(2,8,7)
|
||||
|
||||
if (center != NULL)
|
||||
dc.GradientFillConcentric(rect, color1, color2, wxPoint(center->h, center->v));
|
||||
else
|
||||
dc.GradientFillConcentric(rect, color1, color2);
|
||||
#else
|
||||
wxBrush* brush = wxTheBrushList->FindOrCreateBrush(color1, wxSOLID);
|
||||
wxPen* pen = wxThePenList->FindOrCreatePen(color2, 0, wxSOLID);
|
||||
dc.SetBrush(*brush);
|
||||
dc.SetPen(*pen);
|
||||
dc.DrawEllipse(rect);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@ -1252,27 +1241,8 @@ void xvt_dwin_draw_gradient_linear(WINDOW win, const RCT* r, COLOR col1, COLOR c
|
||||
case 2: dir = wxLEFT; break;
|
||||
default: dir = wxDOWN; break;
|
||||
}
|
||||
#if wxCHECK_VERSION(2,8,7)
|
||||
|
||||
dc.GradientFillLinear(rect, color1, color2, dir);
|
||||
#else
|
||||
// Gradiente dei poveri
|
||||
const bool bVert = dir == wxUP || dir == wxDOWN;
|
||||
if (dir == wxUP || dir == wxLEFT) // Scambia colori se necessario
|
||||
{ const wxColour tmp = color1; color1 = color2; color2 = tmp; }
|
||||
const int n = (bVert ? rect.GetHeight() : rect.GetWidth());
|
||||
for (int i = 0; i < n; i++)
|
||||
{
|
||||
const int r = (color2.Red() * i + color1.Red() *(n-i)) / n;
|
||||
const int g = (color2.Green()* i + color1.Green()*(n-i)) / n;
|
||||
const int b = (color2.Blue() * i + color1.Blue() *(n-i)) / n;
|
||||
wxPen pen(wxColour(r, g, b));
|
||||
dc.SetPen(pen);
|
||||
if (bVert)
|
||||
dc.DrawLine(rect.x, rect.y+i, rect.GetRight(), rect.y+i);
|
||||
else
|
||||
dc.DrawLine(rect.x+i, rect.y, rect.x+i, rect.GetBottom());
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@ -2175,18 +2145,8 @@ long xvt_fsys_file_attr(const char* path, long attr)
|
||||
break;
|
||||
case XVT_FILE_ATTR_SIZE:
|
||||
{
|
||||
#if wxCHECK_VERSION(2,8,7)
|
||||
const wxULongLong sz = wxFileName::GetSize(name);
|
||||
ret = sz.GetHi() != 0 ? INT_MAX : sz.GetLo();
|
||||
#else
|
||||
FILE* f = fopen(name, "r");
|
||||
if (f != NULL)
|
||||
{
|
||||
fseek(f, 0, SEEK_END);
|
||||
ret = ftell(f);
|
||||
fclose(f);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
break;
|
||||
case XVT_FILE_ATTR_MTIME:
|
||||
@ -2535,7 +2495,7 @@ BOOLEAN xvt_menu_popup(MENU_ITEM *menu_p, WINDOW win, PNT pos,
|
||||
for (MENU_ITEM* mi = menu_p; mi != NULL && mi->tag != 0; mi++)
|
||||
{
|
||||
wxMenuItem* item = NULL;
|
||||
#if wxCHECK_VERSION(2,8,7)
|
||||
|
||||
if (mi->separator)
|
||||
menu.AppendSeparator();
|
||||
else
|
||||
@ -2545,13 +2505,7 @@ BOOLEAN xvt_menu_popup(MENU_ITEM *menu_p, WINDOW win, PNT pos,
|
||||
else
|
||||
item = menu.Append(mi->tag, mi->text);
|
||||
}
|
||||
#else
|
||||
if (mi->separator)
|
||||
item = new wxMenuItem(&menu, wxID_SEPARATOR);
|
||||
else
|
||||
item = new wxMenuItem(&menu, mi->tag, mi->text, wxEmptyString, mi->checkable);
|
||||
menu.Append(item);
|
||||
#endif
|
||||
|
||||
if (item != NULL) // Non e' un sepatatore
|
||||
{
|
||||
item->Enable(mi->enabled); // Fattibile solo dopo l'append
|
||||
@ -2687,11 +2641,7 @@ int xvt_rect_get_width(RCT *rctp)
|
||||
BOOLEAN xvt_rect_has_point(RCT *rctp, PNT pnt)
|
||||
{
|
||||
const wxRect rct = NormalizeRCT(rctp);
|
||||
#if wxCHECK_VERSION(2,8,7)
|
||||
return rct.Contains(pnt.h, pnt.v);
|
||||
#else
|
||||
return rct.Inside(pnt.h, pnt.v);
|
||||
#endif
|
||||
return rct.Contains(pnt.h, pnt.v);
|
||||
}
|
||||
|
||||
BOOLEAN xvt_rect_intersect(RCT *drctp, RCT *rctp1, RCT *rctp2)
|
||||
@ -2985,11 +2935,10 @@ void xvt_sbar_set_pos(WINDOW win, SCROLL_TYPE t, int pos)
|
||||
case HVGAUGE:
|
||||
{
|
||||
CAST_GAUGE(win, g);
|
||||
#if wxCHECK_VERSION(2,8,7)
|
||||
|
||||
if (g.GetRange() <= 1)
|
||||
g.Pulse();
|
||||
else
|
||||
#endif
|
||||
g.SetValue(pos);
|
||||
}
|
||||
break;
|
||||
@ -3579,14 +3528,12 @@ int xvt_sys_get_session_id()
|
||||
unsigned long xvt_sys_get_free_memory()
|
||||
{
|
||||
unsigned long mem = 0;
|
||||
#if wxCHECK_VERSION(2,8,7)
|
||||
|
||||
if (::wxGetFreeMemory().GetHi())
|
||||
mem = -1;
|
||||
else
|
||||
mem = ::wxGetFreeMemory().GetLo();
|
||||
#else
|
||||
mem = ::wxGetFreeMemory();
|
||||
#endif
|
||||
|
||||
return mem;
|
||||
}
|
||||
|
||||
@ -4310,7 +4257,6 @@ BOOLEAN statbar_destroy(WINDOW win)
|
||||
|
||||
void xvt_btn_set_images(WINDOW win, XVT_IMAGE up, XVT_IMAGE down)
|
||||
{
|
||||
#if wxCHECK_VERSION(2,8,7)
|
||||
wxBitmapButton* pb = (wxBitmapButton*)win;
|
||||
XVT_ASSERT(pb != NULL);
|
||||
|
||||
@ -4349,5 +4295,4 @@ void xvt_btn_set_images(WINDOW win, XVT_IMAGE up, XVT_IMAGE down)
|
||||
pb->SetBitmapSelected(bmpUp);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
@ -1,18 +1,16 @@
|
||||
#include "../xvaga/wxinc.h"
|
||||
|
||||
#if wxCHECK_VERSION(2,8,7)
|
||||
#include <wx/filename.h>
|
||||
#include <wx/snglinst.h>
|
||||
#endif
|
||||
|
||||
#include <wx/filename.h>
|
||||
#include <wx/snglinst.h>
|
||||
|
||||
|
||||
extern int xvt_main(int argc, char** argv);
|
||||
|
||||
class TMainApp : public wxApp
|
||||
{
|
||||
wxLocale m_Locale;
|
||||
#if wxCHECK_VERSION(2,8,7)
|
||||
wxSingleInstanceChecker* m_sic;
|
||||
#endif
|
||||
|
||||
protected:
|
||||
virtual bool OnInit();
|
||||
@ -41,11 +39,10 @@ void TMainApp::OnTimer(wxTimerEvent& event)
|
||||
|
||||
bool TMainApp::OnInit()
|
||||
{
|
||||
#if wxCHECK_VERSION(2,8,7)
|
||||
wxFileName strWrk = argv[0];
|
||||
const wxString strApp = strWrk.GetName().Lower();
|
||||
m_sic = new wxSingleInstanceChecker(strApp);
|
||||
#endif
|
||||
|
||||
m_Locale.Init(wxLocale::GetSystemLanguage()); // wxLANGUAGE_ITALIAN
|
||||
|
||||
wxTimerEvent evt(TIMER_ID);
|
||||
@ -55,9 +52,8 @@ bool TMainApp::OnInit()
|
||||
|
||||
int TMainApp::OnExit()
|
||||
{
|
||||
#if wxCHECK_VERSION(2,8,7)
|
||||
delete m_sic;
|
||||
m_sic = NULL;
|
||||
#endif
|
||||
|
||||
return wxApp::OnExit();
|
||||
}
|
||||
|
@ -108,9 +108,9 @@ protected:
|
||||
virtual bool HasPage(int pageNum);
|
||||
virtual bool OnPrintPage(int pageNum);
|
||||
void ResetDC();
|
||||
#if wxCHECK_VERSION(2,6,1)
|
||||
|
||||
wxDC* CreateDC(const TPRINT_RCD* prcd, const char* title);
|
||||
#endif
|
||||
|
||||
|
||||
public:
|
||||
void SetBadDriver(bool bd) { m_bBadDriver = bd; }
|
||||
@ -148,7 +148,7 @@ void TwxPrintOut::ResetDC()
|
||||
}
|
||||
}
|
||||
|
||||
#if wxCHECK_VERSION(2,6,1)
|
||||
|
||||
static void RCD2data(const TPRINT_RCD* prcd, wxPrintData& data)
|
||||
|
||||
{
|
||||
@ -238,32 +238,12 @@ wxDC* TwxPrintOut::CreateDC(const TPRINT_RCD* prcd, const char* title)
|
||||
}
|
||||
return dc;
|
||||
}
|
||||
#endif
|
||||
|
||||
void TwxPrintOut::InitDC(const TPRINT_RCD* prcd, const char* title)
|
||||
{
|
||||
ResetDC();
|
||||
#if wxCHECK_VERSION(2,6,1)
|
||||
wxDC* dc = CreateDC(prcd, title);
|
||||
#else
|
||||
wxDC* dc = NULL;
|
||||
|
||||
m_prcd = prcd;
|
||||
|
||||
if (m_prcd == NULL)
|
||||
{
|
||||
wxPrinter printer;
|
||||
dc = new wxPrinterDC(printer.GetPrintDialogData().GetPrintData());
|
||||
}
|
||||
else
|
||||
{
|
||||
wxPrintData data;
|
||||
data.SetNativeData(OsWin32_ConvertToNativePrinterInfo((void*)prcd->m_data, prcd->m_size));
|
||||
data.ConvertFromNative();
|
||||
dc = new wxPrinterDC(data);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
wxSize s = dc->GetPPI();
|
||||
if (s.x >0)
|
||||
SetPPIPrinter(s.x, s.y);
|
||||
@ -433,25 +413,13 @@ BOOLEAN xvt_app_escape(int esc_code, PRINT_RCD* rcd, long* ph, long* pw, long* p
|
||||
|
||||
TPRINT_RCD* prcd = (TPRINT_RCD*)rcd;
|
||||
#ifdef WIN32
|
||||
#if wxCHECK_VERSION(2,6,1)
|
||||
RCD2data(prcd, data);
|
||||
#else
|
||||
data.SetNativeData(OsWin32_ConvertToNativePrinterInfo(prcd->m_data, prcd->m_size));
|
||||
|
||||
data.ConvertFromNative();
|
||||
#endif
|
||||
RCD2data(prcd, data);
|
||||
|
||||
data.SetOrientation(*ph > *pw ? 1 : 2);
|
||||
data.ConvertToNative();
|
||||
|
||||
#if wxCHECK_VERSION(2,6,1)
|
||||
data2RCD(data, prcd);
|
||||
#else
|
||||
void* pHandle = data.GetNativeData();
|
||||
unsigned int nSize = 0;
|
||||
void* ptr = OsWin32_ConvertFromNativePrinterInfo(pHandle, nSize);
|
||||
prcd->SetData(ptr, nSize);
|
||||
delete ptr;
|
||||
#endif
|
||||
|
||||
#else
|
||||
RCD2data(prcd, data);
|
||||
@ -476,35 +444,15 @@ BOOLEAN xvt_dm_post_page_setup(PRINT_RCD* precp)
|
||||
|
||||
wxPageSetupData& pdd = dlg.GetPageSetupData();
|
||||
wxPrintData& data = pdd.GetPrintData();
|
||||
#ifdef WIN32
|
||||
#if wxCHECK_VERSION(2,6,1)
|
||||
RCD2data(rcd, data);
|
||||
#else
|
||||
void* pHandle = OsWin32_ConvertToNativePrinterInfo(rcd->m_data, rcd->m_size);
|
||||
data.SetNativeData(pHandle);
|
||||
data.ConvertFromNative();
|
||||
#endif
|
||||
#else
|
||||
RCD2data(rcd, data);
|
||||
#endif
|
||||
|
||||
RCD2data(rcd, data);
|
||||
|
||||
pdd.EnableMargins(false);
|
||||
|
||||
const BOOLEAN ok = dlg.ShowModal() == wxID_OK;
|
||||
if (ok)
|
||||
{
|
||||
#ifdef WIN32
|
||||
#if wxCHECK_VERSION(2,6,1)
|
||||
data2RCD(data, rcd);
|
||||
#else
|
||||
pHandle = data.GetNativeData();
|
||||
unsigned int nSize = 0;
|
||||
void* ptr = OsWin32_ConvertFromNativePrinterInfo(pHandle, nSize);
|
||||
rcd->SetData(ptr, nSize);
|
||||
delete ptr;
|
||||
#endif
|
||||
#else
|
||||
RCD2data(rcd, data);
|
||||
#endif
|
||||
m_PrintoutCache.Reset();
|
||||
}
|
||||
|
||||
|
@ -4,11 +4,7 @@
|
||||
#include "xvt.h"
|
||||
#include "xvtwin.h"
|
||||
|
||||
#if wxCHECK_VERSION(2,8,7)
|
||||
#include "wx/aui/aui.h"
|
||||
#else
|
||||
#include "wx/image.h"
|
||||
#endif
|
||||
|
||||
#include "wx/notebook.h"
|
||||
#include "wx/treectrl.h"
|
||||
@ -475,14 +471,6 @@ bool TwxWindowBase::CreateBase(wxWindow *parent, wxWindowID id, const wxString &
|
||||
// Evita inutili sfarfallamenti in quanto wxWidgets crea le finestre visibili per default
|
||||
wxWindowBase::Show(false);
|
||||
bool ok = Create(parent, id, pos, size, style, title);
|
||||
if (ok)
|
||||
{
|
||||
#if wxCHECK_VERSION(2,8,7)
|
||||
#else
|
||||
SetTitle(title); // Triste necessita', la Create sembra ignorare il titolo
|
||||
#endif
|
||||
}
|
||||
|
||||
return ok;
|
||||
}
|
||||
|
||||
@ -506,9 +494,7 @@ BEGIN_EVENT_TABLE(TwxWindow, TwxWindowBase)
|
||||
EVT_MIDDLE_DOWN(TwxWindow::OnMouseDown)
|
||||
EVT_MIDDLE_UP(TwxWindow::OnMouseUp)
|
||||
EVT_MOTION(TwxWindow::OnMouseMove)
|
||||
#if wxCHECK_VERSION(2,8,7)
|
||||
EVT_MOUSE_CAPTURE_LOST(TwxWindow::OnMouseCaptureLost)
|
||||
#endif
|
||||
EVT_MOUSEWHEEL(TwxWindow::OnMouseWheel)
|
||||
EVT_PAINT(TwxWindow::OnPaint)
|
||||
EVT_RIGHT_DOWN(TwxWindow::OnMouseDown)
|
||||
@ -669,12 +655,10 @@ void TwxWindow::OnMenu(wxCommandEvent& evt)
|
||||
DoXvtEvent(e);
|
||||
}
|
||||
|
||||
#if wxCHECK_VERSION(2,8,7)
|
||||
void TwxWindow::OnMouseCaptureLost(wxMouseCaptureLostEvent& WXUNUSED(e))
|
||||
{
|
||||
xvt_win_release_pointer();
|
||||
}
|
||||
#endif
|
||||
|
||||
void TwxWindow::OnMouseDouble(wxMouseEvent& evt)
|
||||
{
|
||||
@ -880,7 +864,7 @@ void TwxWindow::SetMenuTree(const MENU_ITEM* tree)
|
||||
BOOLEAN TwxWindow::AddPane(wxWindow* wnd, const char* caption, int nDock, int nFlags)
|
||||
{
|
||||
BOOLEAN ok = wnd != NULL;
|
||||
#if wxCHECK_VERSION(2,8,7)
|
||||
|
||||
if (ok)
|
||||
{
|
||||
if (m_pManager == NULL)
|
||||
@ -912,7 +896,7 @@ BOOLEAN TwxWindow::AddPane(wxWindow* wnd, const char* caption, int nDock, int nF
|
||||
if (ok)
|
||||
m_pManager->Update();
|
||||
}
|
||||
#endif
|
||||
|
||||
return ok;
|
||||
}
|
||||
|
||||
@ -933,13 +917,13 @@ TwxWindow::~TwxWindow()
|
||||
{
|
||||
if (_timer)
|
||||
delete _timer;
|
||||
#if wxCHECK_VERSION(2,8,7)
|
||||
|
||||
if (m_pManager)
|
||||
{
|
||||
m_pManager->UnInit(); // Obbligatorio ma, chissa' perche', non gestito dal distruttore!
|
||||
delete m_pManager;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (m_menu)
|
||||
{
|
||||
xvt_res_free_menu_tree(m_menu);
|
||||
@ -1135,12 +1119,10 @@ public:
|
||||
|
||||
class TwxTreeCtrl : public wxTreeCtrl
|
||||
{
|
||||
#if wxCHECK_VERSION(2,8,7)
|
||||
|
||||
WX_DECLARE_VOIDPTR_HASH_MAP(int, XVT_IMAGE_Map);
|
||||
XVT_IMAGE_Map m_img;
|
||||
#else
|
||||
wxHashTable m_img;
|
||||
#endif
|
||||
|
||||
wxFont m_font;
|
||||
int m_nFrozen;
|
||||
|
||||
@ -1158,11 +1140,8 @@ protected:
|
||||
public:
|
||||
void SetNodeImages(const wxTreeItemId& id, XVT_IMAGE item_image,
|
||||
XVT_IMAGE collapsed_image, XVT_IMAGE expanded_image);
|
||||
#if wxCHECK_VERSION(2,8,7)
|
||||
|
||||
virtual bool SetFont(const wxFont& font) { m_font = font; return font.IsOk(); }
|
||||
#else
|
||||
virtual bool SetFont(const wxFont& font) { m_font = font; return true; }
|
||||
#endif
|
||||
virtual wxFont GetFont() const;
|
||||
|
||||
void Suspend();
|
||||
@ -1190,9 +1169,7 @@ protected:
|
||||
virtual void OnDrawItem(wxDC& dc, const wxRect& rect, size_t n) const;
|
||||
virtual wxCoord OnMeasureItem(size_t n) const;
|
||||
virtual void OnMouseMove(wxMouseEvent& e);
|
||||
#if wxCHECK_VERSION(2,8,7)
|
||||
virtual void OnMouseCaptureLost(wxMouseCaptureLostEvent& e);
|
||||
#endif
|
||||
virtual void OnSelected(wxCommandEvent& e);
|
||||
public:
|
||||
int Add(short nIconId, const wxString strText, int nFlags);
|
||||
@ -1435,10 +1412,8 @@ short xvt_notebk_get_num_tabs(WINDOW notebk)
|
||||
|
||||
void xvt_notebk_set_front_page(WINDOW notebk, short tab_no, short page_no)
|
||||
{
|
||||
#if wxCHECK_VERSION(2,8,7)
|
||||
CAST_NOTEBOOK(notebk, nb);
|
||||
nb.ChangeSelection(tab_no); // Non generare eventi di cambio pagina!
|
||||
#endif
|
||||
}
|
||||
|
||||
void xvt_notebk_set_tab_title(WINDOW notebk, short tab_no, const char* title)
|
||||
@ -1536,11 +1511,8 @@ int TwxTreeCtrl::img2int(XVT_IMAGE xvt_img)
|
||||
int i = -1;
|
||||
if (xvt_img != NULL)
|
||||
{
|
||||
#if wxCHECK_VERSION(2,8,7)
|
||||
i = m_img[xvt_img] - 1; // Ho memorizzato indice+1
|
||||
#else
|
||||
i = (int)m_img.Get((long)xvt_img) - 1;
|
||||
#endif
|
||||
|
||||
if (i < 0) // Immagine sconosciuta
|
||||
{
|
||||
const wxImage& img = *(wxImage*)xvt_img;
|
||||
@ -1561,22 +1533,14 @@ int TwxTreeCtrl::img2int(XVT_IMAGE xvt_img)
|
||||
for (int k = 0; k < il->GetImageCount(); k++)
|
||||
{
|
||||
wxImage old = il->GetBitmap(k).ConvertToImage();
|
||||
#if wxCHECK_VERSION(2,8,7)
|
||||
old.Rescale(img.GetWidth(), img.GetHeight(), wxIMAGE_QUALITY_HIGH);
|
||||
#else
|
||||
old.Rescale(img.GetWidth(), img.GetHeight());
|
||||
#endif
|
||||
nil->Add(old);
|
||||
}
|
||||
AssignImageList(il = nil);
|
||||
}
|
||||
}
|
||||
i = il->Add(wxBitmap(img));
|
||||
#if wxCHECK_VERSION(2,8,7)
|
||||
m_img[xvt_img] = i+1; // Memorizzo indice+1
|
||||
#else
|
||||
m_img.Put((long)xvt_img, (wxObject*)(i+1)); // Memorizzo indice+1
|
||||
#endif
|
||||
}
|
||||
if (i < 0)
|
||||
SORRY_BOX();
|
||||
@ -1605,11 +1569,7 @@ void TwxTreeCtrl::SetNodeImages(const wxTreeItemId& id, XVT_IMAGE item_image,
|
||||
|
||||
wxFont TwxTreeCtrl::GetFont() const
|
||||
{
|
||||
#if wxCHECK_VERSION(2,8,7)
|
||||
return m_font.IsOk() ? m_font : wxTreeCtrl::GetFont();
|
||||
#else
|
||||
return wxTreeCtrl::GetFont();
|
||||
#endif
|
||||
}
|
||||
|
||||
void TwxTreeCtrl::Suspend()
|
||||
@ -1728,11 +1688,10 @@ BOOLEAN xvt_treeview_expand_node(WINDOW win, XVT_TREEVIEW_NODE node, BOOLEAN rec
|
||||
{
|
||||
CAST_TREEVIEW(win, tv);
|
||||
const wxTreeItemId id(node);
|
||||
#if wxCHECK_VERSION(2,8,7)
|
||||
|
||||
if (recurse)
|
||||
tv.ExpandAllChildren(id);
|
||||
else
|
||||
#endif
|
||||
tv.Expand(id);
|
||||
}
|
||||
return ok;
|
||||
@ -1837,13 +1796,11 @@ BEGIN_EVENT_TABLE(TwxOutlookBar, wxVListBox)
|
||||
EVT_COMMAND(wxID_ANY, wxEVT_COMMAND_LISTBOX_SELECTED, TwxOutlookBar::OnSelected)
|
||||
EVT_COMMAND(wxID_ANY, wxEVT_COMMAND_LISTBOX_DOUBLECLICKED, TwxOutlookBar::OnSelected)
|
||||
EVT_MOTION(TwxOutlookBar::OnMouseMove)
|
||||
#if wxCHECK_VERSION(2,8,7)
|
||||
EVT_MOUSE_CAPTURE_LOST(TwxOutlookBar::OnMouseCaptureLost)
|
||||
#endif
|
||||
|
||||
|
||||
END_EVENT_TABLE()
|
||||
|
||||
#if wxCHECK_VERSION(2,8,7)
|
||||
static wxAuiDockArt* GetArtist(const wxWindow* pWindow)
|
||||
{
|
||||
wxAuiDockArt* pArtist = NULL;
|
||||
@ -1852,7 +1809,6 @@ static wxAuiDockArt* GetArtist(const wxWindow* pWindow)
|
||||
pArtist = pManager->GetArtProvider();
|
||||
return pArtist;
|
||||
}
|
||||
#endif
|
||||
|
||||
static const wxColour ModulateColour(const wxColour& col, int percent)
|
||||
{
|
||||
@ -1902,14 +1858,12 @@ void TwxOutlookBar::OnDrawBackground(wxDC& dc, const wxRect& rect, size_t n) con
|
||||
color2 = DarkerColor(wxSystemSettings::GetColour(wxSYS_COLOUR_ACTIVECAPTION));
|
||||
}
|
||||
}
|
||||
#if wxCHECK_VERSION(2,8,7)
|
||||
dc.GradientFillLinear(rect, color1, color2, wxDOWN);
|
||||
#endif
|
||||
}
|
||||
|
||||
void TwxOutlookBar::OnDrawItem(wxDC& dc, const wxRect& rect, size_t n) const
|
||||
{
|
||||
#if wxCHECK_VERSION(2,8,7)
|
||||
|
||||
const int nSide = rect.height;
|
||||
const TwxOutlookItem& oi = m_item[n];
|
||||
int nTextOffset = 4;
|
||||
@ -1933,7 +1887,7 @@ void TwxOutlookBar::OnDrawItem(wxDC& dc, const wxRect& rect, size_t n) const
|
||||
|
||||
const wxSize szText = dc.GetTextExtent(oi.m_strText);
|
||||
dc.DrawText(oi.m_strText, rect.x+nTextOffset, rect.y+(nSide-szText.y)/2);
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
wxCoord TwxOutlookBar::OnMeasureItem(size_t n) const
|
||||
@ -1950,7 +1904,6 @@ wxCoord TwxOutlookBar::OnMeasureItem(size_t n) const
|
||||
|
||||
void TwxOutlookBar::OnMouseMove(wxMouseEvent& evt)
|
||||
{
|
||||
#if wxCHECK_VERSION(2,8,7)
|
||||
int nHover = HitTest(evt.GetPosition());
|
||||
if (m_bCaptured && nHover != wxNOT_FOUND)
|
||||
{
|
||||
@ -1985,10 +1938,8 @@ void TwxOutlookBar::OnMouseMove(wxMouseEvent& evt)
|
||||
if (m_nHovering != wxNOT_FOUND)
|
||||
RefreshLine(m_nHovering);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
#if wxCHECK_VERSION(2,8,7)
|
||||
void TwxOutlookBar::OnMouseCaptureLost(wxMouseCaptureLostEvent&)
|
||||
{
|
||||
m_bCaptured = false;
|
||||
@ -1999,7 +1950,6 @@ void TwxOutlookBar::OnMouseCaptureLost(wxMouseCaptureLostEvent&)
|
||||
RefreshLine(nWasHovering);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
void TwxOutlookBar::OnSelected(wxCommandEvent& evt)
|
||||
{
|
||||
|
@ -142,9 +142,7 @@ protected:
|
||||
virtual void OnKeyDown(wxKeyEvent& e);
|
||||
virtual void OnKillFocus(wxFocusEvent& e);
|
||||
virtual void OnMenu(wxCommandEvent& e);
|
||||
#if wxCHECK_VERSION(2,8,0)
|
||||
virtual void OnMouseCaptureLost(wxMouseCaptureLostEvent& e);
|
||||
#endif
|
||||
virtual void OnMouseDouble(wxMouseEvent& e);
|
||||
virtual void OnMouseDown(wxMouseEvent& e);
|
||||
virtual void OnMouseMove(wxMouseEvent& e);
|
||||
|
Loading…
x
Reference in New Issue
Block a user