Patch level : 10.0

Files correlati     : xvaga.dll
Ricompilazione Demo : [ ]
Commento            :
0000875: griglie - patch 98
 la prima nota, in questa versione emette delle righe di separazione campi della griglia non corrispondenti alle colonne, se si allarga la colonna la riga divisoria finta sparisce.


git-svn-id: svn://10.65.10.50/trunk@17310 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
guy 2008-09-26 13:35:22 +00:00
parent f01717c80b
commit 50fe8cea88
3 changed files with 54 additions and 20 deletions

View File

@ -38,8 +38,8 @@
#endif #endif
#define XVT_ASSERT(test) _AssertBox((test), __FUNCTION__, __FILE__ , __LINE__) #define XVT_ASSERT(test) _AssertBox((test), __FUNCTION__, __FILE__ , __LINE__)
#define CAST_WIN(win,w) wxWindow& w = *wxStaticCast((wxWindow*)win, wxWindow); #define CAST_WIN(win,w) wxWindow& w = *wxStaticCast((wxObject*)win, wxWindow);
#define CAST_TWIN(win,w) TwxWindow& w = *wxStaticCast((wxWindow*)win, TwxWindow); #define CAST_TWIN(win,w) TwxWindow& w = *wxStaticCast((wxObject*)win, TwxWindow);
#define CAST_TDC(win,dc) TDC& dc = GetTDCMapper().GetTDC(win); #define CAST_TDC(win,dc) TDC& dc = GetTDCMapper().GetTDC(win);
#define CAST_DC(win,dc) wxDC& dc = GetTDCMapper().GetDC(win); #define CAST_DC(win,dc) wxDC& dc = GetTDCMapper().GetDC(win);
#define CAST_FONT(font_id, font) TFontId& font = *wxStaticCast(font_id, TFontId); #define CAST_FONT(font_id, font) TFontId& font = *wxStaticCast(font_id, TFontId);
@ -1025,7 +1025,10 @@ char* xvt_dm_post_string_prompt(const char* message, char* response, int respons
XVT_ASSERT(message && response && response_len > 0); XVT_ASSERT(message && response && response_len > 0);
wxTextEntryDialog dlg(NULL, message, _GetAppTitle(), response); wxTextEntryDialog dlg(NULL, message, _GetAppTitle(), response);
if (dlg.ShowModal() == wxID_OK) if (dlg.ShowModal() == wxID_OK)
{
wxStrncpy(response, dlg.GetValue(), response_len); wxStrncpy(response, dlg.GetValue(), response_len);
response[response_len-1] = '\0';
}
else else
*response = '\0'; *response = '\0';
return response; return response;
@ -1692,13 +1695,10 @@ void xvt_dwin_scroll_rect(WINDOW win, RCT *rctp, int dh, int dv)
CAST_WIN(win, w); CAST_WIN(win, w);
if (rctp != NULL) if (rctp != NULL)
{ {
wxRect rct = NormalizeRCT(rctp); const wxRect rct = NormalizeRCT(rctp);
if (rct.width > 0 && rct.height > 0) if (!rct.IsEmpty())
#ifdef WIN32 // w.ScrollWindow(dh, dv, &rct); // Metodo ortodosso ma impreciso di un pixel
w.ScrollWindow(dh, dv, &rct); xvt_dwin_invalidate_rect(win, rctp); // Pezza "TEMPORANEA" per evitare artefatti
#else
xvt_dwin_invalidate_rect(win, rctp);
#endif
} }
else else
w.ScrollWindow(dh, dv); w.ScrollWindow(dh, dv);
@ -1805,7 +1805,7 @@ void xvt_dwin_draw_line(WINDOW win, PNT pnt)
wxDC& dc = tdc.GetDC(); wxDC& dc = tdc.GetDC();
if (tdc._pnt != to) if (tdc._pnt != to)
dc.DrawLine(tdc._pnt, to); dc.DrawLine(tdc._pnt, to);
dc.DrawPoint(to); // dc.DrawPoint(to); // Un giorno capiro' il perche' servisse
tdc._pnt = to; tdc._pnt = to;
} }
@ -2886,6 +2886,17 @@ void xvt_res_free_menu_tree(MENU_ITEM* tree)
} }
} }
XVT_FNTID xvt_res_get_font(int rid)
{
XVT_FNTID f = xvt_font_create();
if (rid <= 0)
{
CAST_FONT(f, font);
font.Copy(wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT));
}
return f;
}
XVT_IMAGE xvt_res_get_image(int rid) XVT_IMAGE xvt_res_get_image(int rid)
{ {
const wxString strFileName = _GetResourceName("Image", rid); const wxString strFileName = _GetResourceName("Image", rid);
@ -4547,8 +4558,7 @@ WINDOW statbar_create(int cid, int left, int top, int right, int bottom,
pStatusBar = w->CreateStatusBar(3, nStyle); pStatusBar = w->CreateStatusBar(3, nStyle);
if (pStatusBar != NULL) if (pStatusBar != NULL)
{ {
const wxSize sz = pStatusBar->GetSize(); const int widths[4] = { -4, -5, -2, 0 };
const int widths[4] = { -4, -3, -2, 0 };
pStatusBar->SetStatusWidths(3, widths); pStatusBar->SetStatusWidths(3, widths);
} }
} }

View File

@ -289,6 +289,7 @@ XVTDLL BOOLEAN xvt_rect_set_pos(RCT *rctp, PNT pos);
XVTDLL void xvt_rect_inflate(RCT *rctp, short ix, short iy); XVTDLL void xvt_rect_inflate(RCT *rctp, short ix, short iy);
XVTDLL void xvt_res_free_menu_tree(MENU_ITEM* tree); XVTDLL void xvt_res_free_menu_tree(MENU_ITEM* tree);
XVTDLL XVT_FNTID xvt_res_get_font(int rid);
XVTDLL XVT_IMAGE xvt_res_get_image(int rid); XVTDLL XVT_IMAGE xvt_res_get_image(int rid);
XVTDLL MENU_ITEM* xvt_res_get_menu(int rid); XVTDLL MENU_ITEM* xvt_res_get_menu(int rid);
XVTDLL char* xvt_res_get_str(int rid, char *s, int sz_s); XVTDLL char* xvt_res_get_str(int rid, char *s, int sz_s);

View File

@ -263,6 +263,14 @@ WINDOW xvt_ctl_create_def(WIN_DEF *win_def_p, WINDOW parent_win, long app_data)
long style = 0; long style = 0;
TwxOutlookBar* tob = new TwxOutlookBar(pParent, id, rct.GetPosition(), rct.GetSize(), style); TwxOutlookBar* tob = new TwxOutlookBar(pParent, id, rct.GetPosition(), rct.GetSize(), style);
win = (WINDOW)tob; win = (WINDOW)tob;
XVT_FNTID font_id = win_def_p->v.ctl.font_id;
if (font_id == NULL)
font_id = xvt_dwin_get_font(parent_win);
if (font_id != NULL)
{
const wxFont& font = ((TFontId*)font_id)->Font(NULL, win);
tob->SetFont(font);
}
} }
break; break;
default: default:
@ -1199,9 +1207,7 @@ void TwxOutlookBar::OnDrawItem(wxDC& dc, const wxRect& rect, size_t n) const
nTextOffset += nTextOffset+szIco.x; nTextOffset += nTextOffset+szIco.x;
} }
wxFont font = wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT); dc.SetFont(GetFont()); // Imposta il font predefinito per questo controllo
font.SetWeight(wxFONTWEIGHT_BOLD);
dc.SetFont(font);
wxColour color = wxSystemSettings::GetColour(wxSYS_COLOUR_CAPTIONTEXT); wxColour color = wxSystemSettings::GetColour(wxSYS_COLOUR_CAPTIONTEXT);
dc.SetTextForeground(color); dc.SetTextForeground(color);
@ -1419,13 +1425,30 @@ BOOLEAN xvt_toolbar_add_control(WINDOW win, int cid, TOOL_TYPE type, const char
default: default:
{ {
const wxBitmap& bmp = _GetToolResource(ico, tb.GetToolBitmapSize().y); const wxBitmap& bmp = _GetToolResource(ico, tb.GetToolBitmapSize().y);
wxString tip; wxString cap, tip;
for (const char* t = title; *t; t++) if (*t != '~' && *t != '&') wxChar acc = 0;
tip << *t; for (const char* t = title; *t; t++)
{
if (*t == '~' || *t == '&')
{
cap << '&';
acc = toupper(*(t+1));
}
else
{
cap << *t;
tip << *t;
}
}
if (acc > '\0')
{
if (acc >= 'A' && acc <= 'Z')
tip << "\n(Alt+" << acc << ")";
}
if (idx < 0) if (idx < 0)
ok = tb.AddTool(cid, title, bmp, wxNullBitmap, wxItemKind(type), tip) != NULL; ok = tb.AddTool(cid, cap, bmp, wxNullBitmap, wxItemKind(type), tip) != NULL;
else else
ok = tb.InsertTool(idx, cid, title, bmp, wxNullBitmap, wxItemKind(type), tip) != NULL; ok = tb.InsertTool(idx, cid, cap, bmp, wxNullBitmap, wxItemKind(type), tip) != NULL;
} }
break; break;
} }