Migliorata grafica bottoni

Corretta gestione helkp html su Win 7

git-svn-id: svn://10.65.10.50/branches/R_10_00@22662 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
guy 2012-05-23 14:40:28 +00:00
parent 5d8a5b2a73
commit 1dbe123220
5 changed files with 106 additions and 36 deletions

View File

@ -467,7 +467,7 @@ static wxString FindHelpFile(const char* topic)
wxString str; wxString str;
for (int i = 0; i < 2; i++) for (int i = 0; i < 2; i++)
{ {
str = GetHelpDir(); str = GetHelpDir();
str += i == 0 ? strTopic.Left(2) : strApp.Left(2); str += i == 0 ? strTopic.Left(2) : strApp.Left(2);
str += "help.pdf"; str += "help.pdf";
if (::wxFileExists(str)) if (::wxFileExists(str))
@ -542,7 +542,18 @@ int OsWin32_Help(WXHWND handle, const char* hlp, unsigned int cmd, const char* t
} }
} else } else
if (str.EndsWith(".html")) if (str.EndsWith(".html"))
::ShellExecute((HWND)handle, "open", str, NULL, NULL, SW_SHOWDEFAULT); {
wxFileName fn = str;
fn.MakeAbsolute();
str = fn.GetFullPath();
unsigned long err = (unsigned long)::ShellExecute((HWND)handle, "open", str, NULL, NULL, SW_SHOWNORMAL);
if (err <= 32)
{
wxString msg;
msg << "Can't open '" << str << "': error " << err;
wxMessageBox(msg, "Campo", wxICON_WARNING | wxOK);
}
}
return true; return true;
} }

View File

@ -788,6 +788,14 @@ void xvt_dwin_draw_arc(WINDOW win, const RCT* r, int sx, int sy, int ex, int ey)
} }
} }
void xvt_dwin_draw_checkmark(WINDOW win, const RCT* rctp)
{
CAST_DC(win, dc);
const wxRect rct = RCT2Rect(rctp);
dc.DrawCheckMark(rct);
}
void xvt_dwin_draw_gradient_circular(WINDOW win, const RCT* r, COLOR col1, COLOR col2, const PNT* center) void xvt_dwin_draw_gradient_circular(WINDOW win, const RCT* r, COLOR col1, COLOR col2, const PNT* center)
{ {
if (win != NULL_WIN && r != NULL) if (win != NULL_WIN && r != NULL)
@ -957,7 +965,7 @@ void xvt_dwin_draw_polyline(WINDOW win, const PNT *lpnts, int npnts)
} }
} }
void xvt_dwin_draw_rect(WINDOW win, RCT *rctp) void xvt_dwin_draw_rect(WINDOW win, const RCT* rctp)
{ {
CAST_DC(win, dc); CAST_DC(win, dc);
const wxRect rct = RCT2Rect(rctp); const wxRect rct = RCT2Rect(rctp);

View File

@ -111,6 +111,7 @@ XVTDLL int xvt_dongle_sa_test(const char* module);
XVTDLL void xvt_dwin_clear(WINDOW win, COLOR col); XVTDLL void xvt_dwin_clear(WINDOW win, COLOR col);
XVTDLL void xvt_dwin_draw_arc(WINDOW win, const RCT* r, int sx, int sy, int ex, int ey); XVTDLL void xvt_dwin_draw_arc(WINDOW win, const RCT* r, int sx, int sy, int ex, int ey);
XVTDLL void xvt_dwin_draw_checkmark(WINDOW win, const RCT* rctp);
XVTDLL void xvt_dwin_draw_icon(WINDOW win, int x, int y, int rid); XVTDLL void xvt_dwin_draw_icon(WINDOW win, int x, int y, int rid);
XVTDLL void xvt_dwin_draw_icon_rect(WINDOW win, RCT* rct, int rid); XVTDLL void xvt_dwin_draw_icon_rect(WINDOW win, RCT* rct, int rid);
XVTDLL void xvt_dwin_draw_gradient_circular(WINDOW win, const RCT* r, COLOR col1, COLOR col2, const PNT* center); // Added by AGA XVTDLL void xvt_dwin_draw_gradient_circular(WINDOW win, const RCT* r, COLOR col1, COLOR col2, const PNT* center); // Added by AGA
@ -122,7 +123,7 @@ XVTDLL void xvt_dwin_draw_oval(WINDOW Win, const RCT* r);
XVTDLL void xvt_dwin_draw_pie(WINDOW win, const RCT *rctp, int start_x, int start_y, int stop_x, int stop_y); XVTDLL void xvt_dwin_draw_pie(WINDOW win, const RCT *rctp, int start_x, int start_y, int stop_x, int stop_y);
XVTDLL void xvt_dwin_draw_polygon(WINDOW win, const PNT *lpnts, int npnts); XVTDLL void xvt_dwin_draw_polygon(WINDOW win, const PNT *lpnts, int npnts);
XVTDLL void xvt_dwin_draw_polyline(WINDOW win, const PNT *lpnts, int npnts); XVTDLL void xvt_dwin_draw_polyline(WINDOW win, const PNT *lpnts, int npnts);
XVTDLL void xvt_dwin_draw_rect(WINDOW win, RCT *rctp); XVTDLL void xvt_dwin_draw_rect(WINDOW win, const RCT *rctp);
XVTDLL void xvt_dwin_draw_roundrect(WINDOW win, const RCT *rctp, int oval_width, int oval_height); XVTDLL void xvt_dwin_draw_roundrect(WINDOW win, const RCT *rctp, int oval_width, int oval_height);
XVTDLL void xvt_dwin_draw_dotted_rect(WINDOW win, RCT *rctp); // Added by Guy XVTDLL void xvt_dwin_draw_dotted_rect(WINDOW win, RCT *rctp); // Added by Guy
XVTDLL void xvt_dwin_draw_tool(WINDOW win, int x, int y, int rid, int size); // Added by Guy XVTDLL void xvt_dwin_draw_tool(WINDOW win, int x, int y, int rid, int size); // Added by Guy

View File

@ -109,6 +109,7 @@ class TwxNoteBook : public wxAuiNotebook
protected: protected:
virtual bool SetBackgroundColour(const wxColour& col); virtual bool SetBackgroundColour(const wxColour& col);
virtual bool SetForegroundColour(const wxColour& col);
void OnChar(wxKeyEvent& evt); void OnChar(wxKeyEvent& evt);
void OnPageChanging(wxAuiNotebookEvent& e); void OnPageChanging(wxAuiNotebookEvent& e);
@ -236,6 +237,7 @@ protected:
virtual void OnKillFocus(wxFocusEvent& e); virtual void OnKillFocus(wxFocusEvent& e);
virtual void OnSelected(wxCommandEvent& e); virtual void OnSelected(wxCommandEvent& e);
virtual void OnKeyDown(wxKeyEvent& e); virtual void OnKeyDown(wxKeyEvent& e);
virtual void OnLeftDown(wxMouseEvent& e);
public: public:
int Add(const wxString str); int Add(const wxString str);
@ -650,11 +652,29 @@ XVTDLL BOOLEAN xvt_pane_set_size_range(WINDOW win, int min_size, int best_size,
class TwxAuiDefaultTabArt : public wxAuiDefaultTabArt class TwxAuiDefaultTabArt : public wxAuiDefaultTabArt
{ {
wxColour m_fore_colour;
protected:
virtual void DrawTab(wxDC& dc, wxWindow* wnd, const wxAuiNotebookPage& pane,
const wxRect& in_rect, int close_button_state,
wxRect* out_tab_rect, wxRect* out_button_rect, int* x_extent);
public: public:
void SetBackgroundColour(const wxColor& colour) { m_base_colour = colour; } void SetBackgroundColour(const wxColor& colour) { m_base_colour = colour; }
void SetForegroundColour(const wxColor& colour) { m_fore_colour = colour; }
virtual wxAuiTabArt* Clone(); virtual wxAuiTabArt* Clone();
}; };
void TwxAuiDefaultTabArt::DrawTab(wxDC& dc, wxWindow* wnd, const wxAuiNotebookPage& pane,
const wxRect& in_rect, int close_button_state,
wxRect* out_tab_rect, wxRect* out_button_rect, int* x_extent)
{
dc.SetTextForeground(m_fore_colour);
wxAuiDefaultTabArt::DrawTab(dc, wnd, pane, in_rect, close_button_state,
out_tab_rect, out_button_rect, x_extent);
}
wxAuiTabArt* TwxAuiDefaultTabArt::Clone() wxAuiTabArt* TwxAuiDefaultTabArt::Clone()
{ {
TwxAuiDefaultTabArt* art = new TwxAuiDefaultTabArt(); TwxAuiDefaultTabArt* art = new TwxAuiDefaultTabArt();
@ -666,6 +686,7 @@ wxAuiTabArt* TwxAuiDefaultTabArt::Clone()
// My own addition // My own addition
art->m_base_colour = m_base_colour; art->m_base_colour = m_base_colour;
art->m_fore_colour = m_fore_colour;
return art; return art;
} }
@ -695,6 +716,19 @@ bool TwxNoteBook::SetBackgroundColour(const wxColour& col)
return ok; return ok;
} }
bool TwxNoteBook::SetForegroundColour(const wxColour& col)
{
const bool ok = wxAuiNotebook::SetForegroundColour(col);
if (ok) // Se cambio il colore del testo del tab control devo notificarlo all'art provider
{
TwxAuiDefaultTabArt* pArtist = (TwxAuiDefaultTabArt*)GetArtProvider();
if (pArtist != NULL)
pArtist->SetForegroundColour(col);
}
return ok;
}
void TwxNoteBook::OnChar(wxKeyEvent& evt) void TwxNoteBook::OnChar(wxKeyEvent& evt)
{ {
// Ridirige i tasti che non sono certamente di navigazione alla finestra nonna // Ridirige i tasti che non sono certamente di navigazione alla finestra nonna
@ -1833,6 +1867,7 @@ BEGIN_EVENT_TABLE(TwxPopUp, wxVListBox)
EVT_COMMAND(wxID_ANY, wxEVT_COMMAND_LISTBOX_SELECTED, TwxPopUp::OnSelected) EVT_COMMAND(wxID_ANY, wxEVT_COMMAND_LISTBOX_SELECTED, TwxPopUp::OnSelected)
EVT_COMMAND(wxID_ANY, wxEVT_COMMAND_LISTBOX_DOUBLECLICKED, TwxPopUp::OnSelected) EVT_COMMAND(wxID_ANY, wxEVT_COMMAND_LISTBOX_DOUBLECLICKED, TwxPopUp::OnSelected)
EVT_MOTION(TwxPopUp::OnMouseMove) EVT_MOTION(TwxPopUp::OnMouseMove)
EVT_LEFT_DOWN(TwxPopUp::OnLeftDown)
EVT_KILL_FOCUS(TwxPopUp::OnKillFocus) EVT_KILL_FOCUS(TwxPopUp::OnKillFocus)
EVT_KEY_DOWN(TwxPopUp::OnKeyDown) EVT_KEY_DOWN(TwxPopUp::OnKeyDown)
END_EVENT_TABLE() END_EVENT_TABLE()
@ -1887,6 +1922,16 @@ void TwxPopUp::OnMouseMove(wxMouseEvent& evt)
} }
} }
void TwxPopUp::OnLeftDown(wxMouseEvent& evt)
{
const wxRect rect = GetClientRect();
const wxPoint pt = evt.GetPosition();
if (rect.Contains(evt.GetPosition()))
wxVListBox::OnLeftDown(evt);
else
Hide();
}
void TwxPopUp::OnKillFocus(wxFocusEvent& WXUNUSED(e)) void TwxPopUp::OnKillFocus(wxFocusEvent& WXUNUSED(e))
{ {
Hide(); Hide();
@ -2040,15 +2085,20 @@ MENU_TAG xvt_list_popup(WINDOW parent_win, const RCT* ownrct, const MENU_ITEM* m
lb->SetSelection(sel); lb->SetSelection(sel);
lb->Show(); lb->Show();
lb->SetFocus(); lb->SetFocus();
lb->CaptureMouse();
wxApp* a = wxTheApp; // Memorizzo il risultato di wxGetInstance
while (lb->IsShown()) while (lb->IsShown())
{ {
wxApp* a = wxTheApp; // Memorizzo il risultato di wxGetInstance
while (a->Pending()) while (a->Pending())
a->Dispatch(); a->Dispatch();
lb->Raise(); lb->Raise();
a->ProcessIdle();
wxMilliSleep(50); wxMilliSleep(50);
} }
sel = lb->GetSelection(); sel = lb->GetSelection();
lb->ReleaseMouse();
delete lb; delete lb;
} }
} }
@ -2076,6 +2126,8 @@ protected:
void OnTool(wxCommandEvent& evt); void OnTool(wxCommandEvent& evt);
void OnEraseBackground(wxEraseEvent& evt); void OnEraseBackground(wxEraseEvent& evt);
virtual bool SetBackgroundColour(const wxColour& colour); virtual bool SetBackgroundColour(const wxColour& colour);
virtual bool SetForegroundColour(const wxColour& colour);
TwxToolBar() : TwxToolBarBase(NULL, wxID_ANY) { wxASSERT(false); } TwxToolBar() : TwxToolBarBase(NULL, wxID_ANY) { wxASSERT(false); }
public: public:
@ -2120,32 +2172,19 @@ void TwxToolBar::OnEraseBackground(wxEraseEvent& evt)
const wxColour b1 = ModulateColour(b0, -10); const wxColour b1 = ModulateColour(b0, -10);
const wxColour b2 = ModulateColour(b0, +70); const wxColour b2 = ModulateColour(b0, +70);
wxCoord cw, ch; dc.GetSize(&cw, &ch); wxCoord cw, ch; dc.GetSize(&cw, &ch);
switch (xvt_sys_get_oem_int("OEM", -1)) #if wxCHECK_VERSION(2,8,12)
{ // Nuovo modo: effetto acqua in stile TwxOutlookBar
case 0: const wxColour b3 = ModulateColour(b1, +20);
{ const int delta = 2*ch/5;
// Nuovo modo: effetto acqua in stile TwxOutlookBar wxRect r1(0,0,cw,ch), r2(0,0,cw,ch);
const wxColour b3 = ModulateColour(b1, +20); r1.height = delta;
const int delta = 2*ch/5; r2.y += delta; r2.height -= delta;
wxRect r1(0,0,cw,ch), r2(0,0,cw,ch); dc.GradientFillLinear(r1, b3, b3, wxDOWN);
r1.height = delta; dc.GradientFillLinear(r2, b1, b2, wxDOWN);
r2.y += delta; r2.height -= delta; #else
dc.GradientFillLinear(r1, b3, b3, wxDOWN); // Vecchio modo: gradiente classico
dc.GradientFillLinear(r2, b1, b2, wxDOWN); dc.GradientFillLinear(wxRect(0,0,cw,ch),b1,b2,wxSOUTH);
} #endif
break;
case 1:
// Vecchio modo: gradiente classico
dc.GradientFillLinear(wxRect(0,0,cw,ch),b1,b2,wxSOUTH);
break;
default:
{
wxBrush brush(b0);
dc.SetBackground(brush);
dc.Clear();
}
break;
}
} }
} }
@ -2161,6 +2200,19 @@ bool TwxToolBar::SetBackgroundColour(const wxColour& colour)
return ok; return ok;
} }
bool TwxToolBar::SetForegroundColour(const wxColour& colour)
{
const bool ok = TwxToolBarBase::SetForegroundColour(colour);
if (ok) // Se cambio lo sfondo della toolbar devo aggiornare anche quello del gripper
{
wxAuiDockArt* pArtist = FindArtist(this);
if (pArtist != NULL)
pArtist->SetColor(wxAUI_DOCKART_ACTIVE_CAPTION_TEXT_COLOUR, colour);
}
return ok;
}
void TwxToolBar::SetBackgroundTexture(XVT_IMAGE xvt_img) void TwxToolBar::SetBackgroundTexture(XVT_IMAGE xvt_img)
{ {
if (xvt_img != NULL) if (xvt_img != NULL)

View File

@ -488,7 +488,7 @@ int xvt_dm_speech_enabled(void)
void xvt_dm_post_about_box() void xvt_dm_post_about_box()
{ {
const char* ver = (const char*)xvt_vobj_get_attr(NULL_WIN, ATTR_APPL_VERSION_STRING); const char* ver = (const char*)xvt_vobj_get_attr(NULL_WIN, ATTR_APPL_VERSION_STRING);
if (ver == NULL || !*ver) ver = "2010 10.0/900"; if (ver == NULL || !*ver) ver = "2012 11.0/200";
wxString msg; msg << "Versione " << ver; wxString msg; msg << "Versione " << ver;
xvt_dm_post_message(msg); xvt_dm_post_message(msg);
} }
@ -743,14 +743,12 @@ BOOLEAN xvt_dm_post_font_sel(WINDOW win, XVT_FNTID font_id, PRINT_RCD* WXUNUSED(
void xvt_dm_post_message(const char *fmt) void xvt_dm_post_message(const char *fmt)
{ {
//_MessageBox(fmt, wxOK | wxICON_INFORMATION); _MessageBox(fmt, wxOK | wxICON_INFORMATION);
_PopUpBox(fmt, wxICON_INFORMATION, 0);
} }
void xvt_dm_post_note(const char *fmt) void xvt_dm_post_note(const char *fmt)
{ {
// _MessageBox(fmt, wxOK | wxICON_EXCLAMATION); _PopUpBox(fmt, wxICON_INFORMATION);
_PopUpBox(fmt, wxICON_EXCLAMATION, 0);
} }
char* xvt_dm_post_string_prompt(const char* message, char* response, int response_len) char* xvt_dm_post_string_prompt(const char* message, char* response, int response_len)