Patch level : 10.0
Files correlati : xvaga.dll Ricompilazione Demo : [ ] Commento : Aggiunto supporto per MessageBox con testo HTML git-svn-id: svn://10.65.10.50/branches/R_10_00@22404 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
f6de739122
commit
9bf638209b
@ -5,7 +5,7 @@
|
||||
* Agreement with XVT Software.
|
||||
*
|
||||
* $RCSfile: xvt_menu.h,v $
|
||||
* $Revision: 1.2 $
|
||||
* $Revision: 1.2.6.1 $
|
||||
*
|
||||
* Purpose: XVT menu subsystem definitions.
|
||||
*
|
||||
@ -30,11 +30,11 @@
|
||||
#define M_FILE_PREVIEW (M_FILE+11)
|
||||
|
||||
#define M_EDIT 32025
|
||||
#define M_EDIT_UNDO (M_EDIT+1)
|
||||
#define M_EDIT_CUT (M_EDIT+2)
|
||||
#define M_EDIT_COPY (M_EDIT+3)
|
||||
#define M_EDIT_PASTE (M_EDIT+4)
|
||||
#define M_EDIT_CLEAR (M_EDIT+5)
|
||||
#define M_EDIT_UNDO (M_EDIT+1)
|
||||
#define M_EDIT_CUT (M_EDIT+2)
|
||||
#define M_EDIT_COPY (M_EDIT+3)
|
||||
#define M_EDIT_PASTE (M_EDIT+4)
|
||||
#define M_EDIT_CLEAR (M_EDIT+5)
|
||||
#define M_EDIT_SEL_ALL (M_EDIT+6)
|
||||
#define M_EDIT_CLIPBOARD (M_EDIT+7)
|
||||
|
||||
|
@ -2100,19 +2100,35 @@ void TwxToolBar::OnEraseBackground(wxEraseEvent& evt)
|
||||
}
|
||||
else
|
||||
{
|
||||
if (xvt_sys_get_oem_int("OEM", -1) == 0)
|
||||
const wxColour b0 = GetBackgroundColour();
|
||||
const wxColour b1 = ModulateColour(b0, -10);
|
||||
const wxColour b2 = ModulateColour(b0, +70);
|
||||
wxCoord cw, ch; dc.GetSize(&cw, &ch);
|
||||
switch (xvt_sys_get_oem_int("OEM", -1))
|
||||
{
|
||||
wxCoord cw, ch; dc.GetSize(&cw, &ch);
|
||||
const wxColour b0 = GetBackgroundColour();
|
||||
const wxColour b1 = ModulateColour(b0, -10);
|
||||
const wxColour b2 = ModulateColour(b0, +70);
|
||||
dc.GradientFillLinear(wxRect(0,0,cw,ch),b1,b2,wxSOUTH);
|
||||
}
|
||||
else
|
||||
{
|
||||
wxBrush brush(GetBackgroundColour());
|
||||
dc.SetBackground(brush);
|
||||
dc.Clear();
|
||||
case 0:
|
||||
{
|
||||
// Nuovo modo: effetto acqua in stile TwxOutlookBar
|
||||
const wxColour b3 = ModulateColour(b1, +20);
|
||||
const int delta = 2*ch/5;
|
||||
wxRect r1(0,0,cw,ch), r2(0,0,cw,ch);
|
||||
r1.height = delta;
|
||||
r2.y += delta; r2.height -= delta;
|
||||
dc.GradientFillLinear(r1, b3, b3, wxDOWN);
|
||||
dc.GradientFillLinear(r2, b1, b2, wxDOWN);
|
||||
}
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -7,6 +7,7 @@
|
||||
#include <wx/calctrl.h>
|
||||
#include <wx/colordlg.h>
|
||||
#include <wx/fontdlg.h>
|
||||
#include <wx/wxhtml.h>
|
||||
#include <wx/statline.h>
|
||||
#include <wx/tokenzr.h>
|
||||
|
||||
@ -117,22 +118,31 @@ TMessageBox::TMessageBox(wxWindow* pParent, const wxString& msg, int nStyle, int
|
||||
|
||||
sz1->Add(new wxStaticBitmap(this, wxID_ANY, img), 0, wxALL|wxALIGN_CENTER, nBorder);
|
||||
|
||||
wxStaticText* ss = NULL;
|
||||
if (bTerminalino)
|
||||
if (msg.StartsWith("<html>") && msg.EndsWith("</html>"))
|
||||
{
|
||||
int nLines = 0;
|
||||
wxStringTokenizer tok(msg, wxT("\n"));
|
||||
for (nLines = 0; tok.HasMoreTokens(); nLines++)
|
||||
nLines += tok.GetNextToken().Len()/32;
|
||||
ss = new wxStaticText(this, wxID_ANY, wxEmptyString, wxDefaultPosition,
|
||||
wxSize(nWrap, 16*nLines), wxST_NO_AUTORESIZE);
|
||||
wxHtmlWindow* html = new wxHtmlWindow(this, wxID_ANY, wxDefaultPosition, wxSize(nWrap,nWrap/1.6180339887));
|
||||
html->SetPage(msg);
|
||||
sz1->Add(html, 0, wxALL|wxALIGN_CENTER|wxALIGN_CENTER_VERTICAL, nBorder);
|
||||
}
|
||||
else
|
||||
ss = new wxStaticText(this, wxID_ANY, wxEmptyString);
|
||||
{
|
||||
wxStaticText* ss = NULL;
|
||||
if (bTerminalino)
|
||||
{
|
||||
int nLines = 0;
|
||||
wxStringTokenizer tok(msg, wxT("\n"));
|
||||
for (nLines = 0; tok.HasMoreTokens(); nLines++)
|
||||
nLines += tok.GetNextToken().Len()/32;
|
||||
ss = new wxStaticText(this, wxID_ANY, wxEmptyString, wxDefaultPosition,
|
||||
wxSize(nWrap, 16*nLines), wxST_NO_AUTORESIZE);
|
||||
}
|
||||
else
|
||||
ss = new wxStaticText(this, wxID_ANY, wxEmptyString);
|
||||
|
||||
ss->Wrap(nWrap);
|
||||
ss->SetLabel(msg);
|
||||
sz1->Add(ss, 0, wxALL|wxALIGN_CENTER|wxALIGN_CENTER_VERTICAL, nBorder);
|
||||
ss->Wrap(nWrap);
|
||||
ss->SetLabel(msg);
|
||||
sz1->Add(ss, 0, wxALL|wxALIGN_CENTER|wxALIGN_CENTER_VERTICAL, nBorder);
|
||||
}
|
||||
|
||||
sizer->Add(new wxStaticLine(this), 0, wxALL|wxEXPAND, nBorder);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user