Patch level : 4.0
Files correlati : Ricompilazione Demo : [ ] Commento : Risolti problemi di compilazione con vecchio wxWidgets git-svn-id: svn://10.65.10.50/trunk@15196 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
238527b5ba
commit
1faa2eb7f9
153
xvaga/xvaga.cpp
153
xvaga/xvaga.cpp
@ -176,13 +176,13 @@ const wxCursor* GetCursorResource(int rid)
|
|||||||
const wxString strName = ::GetResourceName("Cursor", rid);
|
const wxString strName = ::GetResourceName("Cursor", rid);
|
||||||
if (::wxFileExists(strName))
|
if (::wxFileExists(strName))
|
||||||
{
|
{
|
||||||
#ifdef WIN32
|
#if wxCHECK_VERSION(2,8,0)
|
||||||
if (strName.EndsWith(".ico"))
|
if (strName.EndsWith(".ico"))
|
||||||
cursor = new wxCursor(strName, wxBITMAP_TYPE_ICO);
|
cursor = new wxCursor(strName, wxBITMAP_TYPE_ICO);
|
||||||
else
|
else
|
||||||
cursor = new wxCursor(strName, wxBITMAP_TYPE_CUR);
|
cursor = new wxCursor(strName, wxBITMAP_TYPE_CUR);
|
||||||
#else
|
#else
|
||||||
cursor = wxSTANDARD_CURSOR;
|
cursor = new wxCursor(strName, wxBITMAP_TYPE_CUR);
|
||||||
#endif
|
#endif
|
||||||
if (!cursor->Ok())
|
if (!cursor->Ok())
|
||||||
{
|
{
|
||||||
@ -1572,19 +1572,30 @@ public:
|
|||||||
|
|
||||||
WINDOW xvt_ctl_create_def(WIN_DEF *win_def_p, WINDOW parent_win, long app_data)
|
WINDOW xvt_ctl_create_def(WIN_DEF *win_def_p, WINDOW parent_win, long app_data)
|
||||||
{
|
{
|
||||||
WINDOW win = NULL_WIN;
|
const wxRect rct = NormalizeRCT(&win_def_p->rct);
|
||||||
|
wxWindow* pParent = (wxWindow*)parent_win;
|
||||||
|
|
||||||
|
WINDOW win = NULL_WIN;
|
||||||
switch (win_def_p->wtype)
|
switch (win_def_p->wtype)
|
||||||
{
|
{
|
||||||
case WC_HSCROLL: /* horizontal scrollbar control */
|
case WC_HSCROLL: /* horizontal scrollbar control */
|
||||||
case WC_VSCROLL: /* vertical scrollbar control */
|
case WC_VSCROLL: /* vertical scrollbar control */
|
||||||
{
|
{
|
||||||
const wxRect rct = NormalizeRCT(&win_def_p->rct);
|
const long style = win_def_p->wtype == WC_HSCROLL ? wxSB_HORIZONTAL : wxSB_VERTICAL;
|
||||||
long style = win_def_p->wtype == WC_HSCROLL ? wxSB_HORIZONTAL : wxSB_VERTICAL;
|
TwxScrollBar* sb = new TwxScrollBar(pParent, win_def_p->v.ctl.ctrl_id,
|
||||||
TwxScrollBar* sb = new TwxScrollBar((wxWindow*)parent_win, win_def_p->v.ctl.ctrl_id,
|
|
||||||
rct.GetPosition(), rct.GetSize(), style);
|
rct.GetPosition(), rct.GetSize(), style);
|
||||||
win = (WINDOW)sb;
|
win = (WINDOW)sb;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case WC_HGAUGE: /* horizontal progress bar control */
|
||||||
|
case WC_VGAUGE: /* vertical progress bar control */
|
||||||
|
{
|
||||||
|
const long style = win_def_p->wtype == (WC_HGAUGE ? wxGA_HORIZONTAL : wxGA_VERTICAL);
|
||||||
|
wxGauge* pg = new wxGauge(pParent, win_def_p->v.ctl.ctrl_id, app_data,
|
||||||
|
rct.GetPosition(), rct.GetSize(), style);
|
||||||
|
win = (WINDOW)pg;
|
||||||
|
}
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
SORRY_BOX(); break;
|
SORRY_BOX(); break;
|
||||||
}
|
}
|
||||||
@ -3587,9 +3598,12 @@ BOOLEAN xvt_menu_popup(MENU_ITEM *menu_p, WINDOW win, PNT pos,
|
|||||||
item = new wxMenuItem(&menu, mi->tag, mi->text, wxEmptyString, mi->checkable);
|
item = new wxMenuItem(&menu, mi->tag, mi->text, wxEmptyString, mi->checkable);
|
||||||
menu.Append(item);
|
menu.Append(item);
|
||||||
#endif
|
#endif
|
||||||
item->Enable(mi->enabled); // Fattibile solo dopo l'append
|
if (item != NULL) // Non e' un sepatatore
|
||||||
if (mi->checkable)
|
{
|
||||||
item->Check(mi->checked);
|
item->Enable(mi->enabled); // Fattibile solo dopo l'append
|
||||||
|
if (mi->checkable)
|
||||||
|
item->Check(mi->checked);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
CAST_WIN(win, w);
|
CAST_WIN(win, w);
|
||||||
bool ok = w.PopupMenu(&menu, pos.h, pos.v);
|
bool ok = w.PopupMenu(&menu, pos.h, pos.v);
|
||||||
@ -3930,17 +3944,30 @@ char* xvt_res_get_str(int rid, char *s, int sz_s)
|
|||||||
|
|
||||||
#define CAST_SCROLL(win, sb) XVT_ASSERT(win != NULL_WIN); wxScrollBar& sb = *(wxScrollBar*)win;
|
#define CAST_SCROLL(win, sb) XVT_ASSERT(win != NULL_WIN); wxScrollBar& sb = *(wxScrollBar*)win;
|
||||||
#define CAST_SCROLL_TYPE(t, dir) const int dir = t == HSCROLL ? wxHORIZONTAL : wxVERTICAL;
|
#define CAST_SCROLL_TYPE(t, dir) const int dir = t == HSCROLL ? wxHORIZONTAL : wxVERTICAL;
|
||||||
|
#define CAST_GAUGE(win, pb) XVT_ASSERT(win != NULL_WIN); wxGauge& pb = *(wxGauge*)win;
|
||||||
|
|
||||||
int xvt_sbar_get_pos(WINDOW win, SCROLL_TYPE t)
|
int xvt_sbar_get_pos(WINDOW win, SCROLL_TYPE t)
|
||||||
{
|
{
|
||||||
if (t == HSCROLL || t == VSCROLL)
|
switch (t)
|
||||||
{
|
{
|
||||||
CAST_WIN(win, w);
|
case HSCROLL:
|
||||||
CAST_SCROLL_TYPE(t, dir);
|
case VSCROLL:
|
||||||
return w.GetScrollPos(dir);
|
{
|
||||||
}
|
CAST_WIN(win, w);
|
||||||
CAST_SCROLL(win, sb);
|
CAST_SCROLL_TYPE(t, dir);
|
||||||
return sb.GetThumbPosition();
|
return w.GetScrollPos(dir);
|
||||||
|
}
|
||||||
|
case HVGAUGE:
|
||||||
|
{
|
||||||
|
CAST_GAUGE(win, g);
|
||||||
|
return g.GetValue();
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
{
|
||||||
|
CAST_SCROLL(win, sb);
|
||||||
|
return sb.GetThumbPosition();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int xvt_sbar_get_proportion(WINDOW win, SCROLL_TYPE t)
|
int xvt_sbar_get_proportion(WINDOW win, SCROLL_TYPE t)
|
||||||
@ -3966,25 +3993,47 @@ void xvt_sbar_get_range(WINDOW win, SCROLL_TYPE t, int *minp, int *maxp)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
CAST_SCROLL(win, sb);
|
if (t == HVGAUGE)
|
||||||
*maxp = sb.GetRange();
|
{
|
||||||
|
CAST_GAUGE(win, g);
|
||||||
|
*maxp = g.GetRange();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
CAST_SCROLL(win, sb);
|
||||||
|
*maxp = sb.GetRange();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void xvt_sbar_set_pos(WINDOW win, SCROLL_TYPE t, int pos)
|
void xvt_sbar_set_pos(WINDOW win, SCROLL_TYPE t, int pos)
|
||||||
{
|
{
|
||||||
if (t == HSCROLL || t == VSCROLL)
|
switch(t)
|
||||||
{
|
{
|
||||||
CAST_WIN(win, w);
|
case HSCROLL:
|
||||||
CAST_SCROLL_TYPE(t, dir);
|
case VSCROLL:
|
||||||
w.SetScrollPos(dir, pos);
|
{
|
||||||
}
|
CAST_WIN(win, w);
|
||||||
else
|
CAST_SCROLL_TYPE(t, dir);
|
||||||
{
|
w.SetScrollPos(dir, pos);
|
||||||
CAST_SCROLL(win, sb);
|
}
|
||||||
const int range = sb.GetRange();
|
break;
|
||||||
const int size = sb.GetThumbSize();
|
case HVGAUGE:
|
||||||
sb.SetScrollbar(pos, size, range, size);
|
{
|
||||||
|
CAST_GAUGE(win, g);
|
||||||
|
if (g.GetRange() <= 1)
|
||||||
|
g.Pulse();
|
||||||
|
else
|
||||||
|
g.SetValue(pos);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
{
|
||||||
|
CAST_SCROLL(win, sb);
|
||||||
|
const int range = sb.GetRange();
|
||||||
|
const int size = sb.GetThumbSize();
|
||||||
|
sb.SetScrollbar(pos, size, range, size);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4009,21 +4058,33 @@ void xvt_sbar_set_proportion(WINDOW win, SCROLL_TYPE t, int proportion)
|
|||||||
|
|
||||||
void xvt_sbar_set_range(WINDOW win, SCROLL_TYPE t, int min, int max)
|
void xvt_sbar_set_range(WINDOW win, SCROLL_TYPE t, int min, int max)
|
||||||
{
|
{
|
||||||
XVT_ASSERT(min == 0);
|
XVT_ASSERT(min == 0 && max >= min);
|
||||||
if (t == HSCROLL || t == VSCROLL)
|
switch (t)
|
||||||
{
|
{
|
||||||
CAST_WIN(win, w);
|
case HSCROLL:
|
||||||
CAST_SCROLL_TYPE(t, dir);
|
case VSCROLL:
|
||||||
const int pos = w.GetScrollPos(dir);
|
{
|
||||||
const int size = w.GetScrollThumb(dir);
|
CAST_WIN(win, w);
|
||||||
w.SetScrollbar(dir, pos, size, max);
|
CAST_SCROLL_TYPE(t, dir);
|
||||||
}
|
const int pos = w.GetScrollPos(dir);
|
||||||
else
|
const int size = w.GetScrollThumb(dir);
|
||||||
{
|
w.SetScrollbar(dir, pos, size, max);
|
||||||
CAST_SCROLL(win, sb);
|
}
|
||||||
const int pos = sb.GetThumbPosition();
|
break;
|
||||||
const int size = sb.GetThumbSize();
|
case HVGAUGE:
|
||||||
sb.SetScrollbar(pos, size, max, size);
|
{
|
||||||
|
CAST_GAUGE(win, g);
|
||||||
|
g.SetRange(max);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
{
|
||||||
|
CAST_SCROLL(win, sb);
|
||||||
|
const int pos = sb.GetThumbPosition();
|
||||||
|
const int size = sb.GetThumbSize();
|
||||||
|
sb.SetScrollbar(pos, size, max, size);
|
||||||
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -225,7 +225,9 @@ WC_LISTEDIT, /* edit with field list */
|
|||||||
WC_GROUPBOX, /* group box */
|
WC_GROUPBOX, /* group box */
|
||||||
WC_TEXTEDIT, /* text edit object */
|
WC_TEXTEDIT, /* text edit object */
|
||||||
WC_ICON, /* icon control */
|
WC_ICON, /* icon control */
|
||||||
WO_TE /* text edit */
|
WO_TE, /* text edit */
|
||||||
|
WC_HGAUGE, /* horizontal progress bar */
|
||||||
|
WC_VGAUGE, /* vertical progress bar */
|
||||||
} WIN_TYPE;
|
} WIN_TYPE;
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
@ -240,6 +242,7 @@ typedef enum { /* type of scrollbar */
|
|||||||
HSCROLL, /* horizontal */
|
HSCROLL, /* horizontal */
|
||||||
VSCROLL, /* vertical */
|
VSCROLL, /* vertical */
|
||||||
HVSCROLL, /* either */
|
HVSCROLL, /* either */
|
||||||
|
HVGAUGE /* progress bar */
|
||||||
|
|
||||||
} SCROLL_TYPE;
|
} SCROLL_TYPE;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user