Patch level : 10.0

Files correlati     : xvaga.dll
Ricompilazione Demo : [ ]
Commento            :
Aggiunta voce "Anteprima di stampa"  al menu standard


git-svn-id: svn://10.65.10.50/trunk@18589 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
guy 2009-03-23 15:11:36 +00:00
parent eeec2a7a70
commit c38e5ede26
5 changed files with 116 additions and 51 deletions

View File

@ -524,6 +524,7 @@ void xvt_app_create(int argc, char **argv, unsigned long WXUNUSED(flags),
} }
Menus[0]->Append(M_FILE_PG_SETUP, "&Impostazione Stampante..."); Menus[0]->Append(M_FILE_PG_SETUP, "&Impostazione Stampante...");
Menus[0]->Append(M_FILE_PRINT, "&Stampa"); Menus[0]->Append(M_FILE_PRINT, "&Stampa");
Menus[0]->Append(M_FILE_PREVIEW, "&Anteprima");
Menus[0]->AppendSeparator(); Menus[0]->AppendSeparator();
Menus[0]->Append(M_FILE_QUIT, "&Fine"); Menus[0]->Append(M_FILE_QUIT, "&Fine");
Title[1] = "&Modifica"; Title[1] = "&Modifica";
@ -577,6 +578,8 @@ void xvt_app_destroy(void)
xvt_dm_enable_speech(0x00); xvt_dm_enable_speech(0x00);
#endif #endif
xvt_sign_stop();
if (_locale != NULL) if (_locale != NULL)
{ {
delete _locale; delete _locale;
@ -3959,9 +3962,9 @@ int xvt_sys_get_os_version()
int xvt_sys_get_version(char* os_version, char* ptk_version, int maxsize) int xvt_sys_get_version(char* os_version, char* ptk_version, int maxsize)
{ {
if (os_version) if (os_version && maxsize >= 8)
wxStrncpy(os_version, wxGetOsDescription(), maxsize); wxStrncpy(os_version, wxGetOsDescription(), maxsize);
if (ptk_version) if (ptk_version && maxsize >= 8)
wxStrncpy(ptk_version, wxVERSION_STRING, maxsize); wxStrncpy(ptk_version, wxVERSION_STRING, maxsize);
return xvt_sys_get_os_version(); return xvt_sys_get_os_version();
} }

View File

@ -5,7 +5,7 @@
* Agreement with XVT Software. * Agreement with XVT Software.
* *
* $RCSfile: xvt_menu.h,v $ * $RCSfile: xvt_menu.h,v $
* $Revision: 1.1 $ * $Revision: 1.2 $
* *
* Purpose: XVT menu subsystem definitions. * Purpose: XVT menu subsystem definitions.
* *
@ -27,6 +27,7 @@
#define M_FILE_PRINT (M_FILE+8) #define M_FILE_PRINT (M_FILE+8)
#define M_FILE_QUIT (M_FILE+9) #define M_FILE_QUIT (M_FILE+9)
#define M_FILE_ABOUT (M_FILE+10) #define M_FILE_ABOUT (M_FILE+10)
#define M_FILE_PREVIEW (M_FILE+11)
#define M_EDIT 32025 #define M_EDIT 32025
#define M_EDIT_UNDO (M_EDIT+1) #define M_EDIT_UNDO (M_EDIT+1)

View File

@ -137,7 +137,7 @@ class TwxTreeCtrl : public wxTreeCtrl
{ {
WX_DECLARE_VOIDPTR_HASH_MAP(int, XVT_IMAGE_Map); WX_DECLARE_VOIDPTR_HASH_MAP(int, XVT_IMAGE_Map);
XVT_IMAGE_Map m_img; XVT_IMAGE_Map m_img;
wxColour m_clrSelFore, m_clrSelBack;
int m_nFrozen; int m_nFrozen;
private: private:
@ -152,9 +152,13 @@ protected:
void OnActivated(wxTreeEvent& e); // Calls OnClick(e, true) void OnActivated(wxTreeEvent& e); // Calls OnClick(e, true)
void OnRightDown(wxMouseEvent& e); void OnRightDown(wxMouseEvent& e);
virtual wxColour GetItemTextColour(const wxTreeItemId& id) const;
virtual wxColour GetItemBackgroundColour(const wxTreeItemId& id) const;
public: public:
void SetNodeImages(const wxTreeItemId& id, XVT_IMAGE item_image, void SetNodeImages(const wxTreeItemId& id, XVT_IMAGE item_image,
XVT_IMAGE collapsed_image, XVT_IMAGE expanded_image); XVT_IMAGE collapsed_image, XVT_IMAGE expanded_image);
void SetColors(const XVT_COLOR_COMPONENT* colors);
void Suspend(); void Suspend();
void Resume(); void Resume();
TwxTreeCtrl(wxWindow *parent, wxWindowID id, const wxPoint& pos, const wxSize& size); TwxTreeCtrl(wxWindow *parent, wxWindowID id, const wxPoint& pos, const wxSize& size);
@ -222,6 +226,7 @@ class TwxPropertyGrid : public wxPropertyGrid
protected: protected:
void OnPropertyChanged(wxPropertyGridEvent& evt); void OnPropertyChanged(wxPropertyGridEvent& evt);
public: public:
void SetColors(const XVT_COLOR_COMPONENT* colors);
TwxPropertyGrid(wxWindow *parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style); TwxPropertyGrid(wxWindow *parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style);
}; };
@ -380,26 +385,18 @@ void xvt_ctl_set_colors(WINDOW win, const XVT_COLOR_COMPONENT* colors, XVT_COLOR
{ {
if (action == XVT_COLOR_ACTION_SET) if (action == XVT_COLOR_ACTION_SET)
{ {
wxPropertyGrid* pg = wxDynamicCast(w, wxPropertyGrid); TwxTreeCtrl* tc = wxDynamicCast(w, TwxTreeCtrl);
if (tc != NULL)
{
tc->SetColors(colors);
return;
}
TwxPropertyGrid* pg = wxDynamicCast(w, TwxPropertyGrid);
if (pg != NULL) if (pg != NULL)
{ {
for (int i = 0; colors[i].type; i++) pg->SetColors(colors);
{ return;
CAST_COLOR(colors[i].color, rgb);
switch(colors[i].type)
{
case XVT_COLOR_BACKGROUND: pg->SetCellBackgroundColour(rgb); break;
case XVT_COLOR_FOREGROUND: pg->SetCellTextColour(rgb); pg->SetCaptionForegroundColour(rgb); break;
case XVT_COLOR_HIGHLIGHT : pg->SetSelectionBackground(rgb); break;
case XVT_COLOR_SELECT : pg->SetSelectionForeground(rgb); break;
case XVT_COLOR_BLEND : pg->SetCaptionBackgroundColour(rgb); pg->SetMarginColour(rgb); break;
case XVT_COLOR_TROUGH : pg->SetEmptySpaceColour(rgb); break;
default : break;
} }
}
}
else
{
for (int i = 0; colors[i].type; i++) for (int i = 0; colors[i].type; i++)
{ {
CAST_COLOR(colors[i].color, rgb); CAST_COLOR(colors[i].color, rgb);
@ -430,7 +427,6 @@ void xvt_ctl_set_colors(WINDOW win, const XVT_COLOR_COMPONENT* colors, XVT_COLOR
} }
} }
} }
}
else else
{ {
// ??? // ???
@ -973,11 +969,37 @@ void TwxTreeCtrl::OnClick(wxTreeEvent& evt, bool bDouble)
} }
} }
wxColour TwxTreeCtrl::GetItemTextColour(const wxTreeItemId& id) const
{
if (IsSelected(id))
return m_clrSelFore;
return wxTreeCtrl::GetItemTextColour(id);
}
wxColour TwxTreeCtrl::GetItemBackgroundColour(const wxTreeItemId& id) const
{
if (IsSelected(id))
return m_clrSelBack;
return wxTreeCtrl::GetItemBackgroundColour(id);
}
void TwxTreeCtrl::OnSelected(wxTreeEvent& evt) void TwxTreeCtrl::OnSelected(wxTreeEvent& evt)
{ OnClick(evt, false); } {
OnClick(evt, false);
}
void TwxTreeCtrl::OnActivated(wxTreeEvent& evt) void TwxTreeCtrl::OnActivated(wxTreeEvent& evt)
{ OnClick(evt, true); } {
const wxTreeItemId id = evt.GetItem();
if (ItemHasChildren(id))
{
if (IsExpanded(id))
Collapse(id);
else
Expand(id);
}
OnClick(evt, true);
}
void TwxTreeCtrl::OnRightDown(wxMouseEvent& evt) void TwxTreeCtrl::OnRightDown(wxMouseEvent& evt)
{ {
@ -1083,6 +1105,22 @@ void TwxTreeCtrl::Resume()
m_nFrozen--; m_nFrozen--;
} }
void TwxTreeCtrl::SetColors(const XVT_COLOR_COMPONENT* colors)
{
for (int i = 0; colors[i].type; i++)
{
CAST_COLOR(colors[i].color, rgb);
switch(colors[i].type)
{
case XVT_COLOR_BACKGROUND: SetOwnBackgroundColour(rgb); break;
case XVT_COLOR_FOREGROUND: SetOwnForegroundColour(rgb); break;
case XVT_COLOR_HIGHLIGHT : m_clrSelBack = rgb; break;
case XVT_COLOR_SELECT : m_clrSelFore = rgb; break;
default : break;
}
}
}
TwxTreeCtrl::TwxTreeCtrl(wxWindow *parent, wxWindowID id, TwxTreeCtrl::TwxTreeCtrl(wxWindow *parent, wxWindowID id,
const wxPoint& pos, const wxSize& size) const wxPoint& pos, const wxSize& size)
: wxTreeCtrl(parent, id, pos, size, wxTR_HAS_BUTTONS | wxTR_HIDE_ROOT), : wxTreeCtrl(parent, id, pos, size, wxTR_HAS_BUTTONS | wxTR_HIDE_ROOT),
@ -2125,6 +2163,25 @@ BEGIN_EVENT_TABLE(TwxPropertyGrid, wxPropertyGrid)
EVT_PG_CHANGED(wxID_ANY, TwxPropertyGrid::OnPropertyChanged) EVT_PG_CHANGED(wxID_ANY, TwxPropertyGrid::OnPropertyChanged)
END_EVENT_TABLE(); END_EVENT_TABLE();
void TwxPropertyGrid::SetColors(const XVT_COLOR_COMPONENT* colors)
{
for (int i = 0; colors[i].type; i++)
{
CAST_COLOR(colors[i].color, rgb);
switch(colors[i].type)
{
case XVT_COLOR_BACKGROUND: SetCellBackgroundColour(rgb); break;
case XVT_COLOR_FOREGROUND: SetCellTextColour(rgb); SetCaptionForegroundColour(rgb); break;
case XVT_COLOR_HIGHLIGHT : SetSelectionBackground(rgb); break;
case XVT_COLOR_SELECT : SetSelectionForeground(rgb); break;
case XVT_COLOR_BLEND : SetCaptionBackgroundColour(rgb); SetMarginColour(rgb); break;
case XVT_COLOR_TROUGH : SetEmptySpaceColour(rgb); break;
default : break;
}
}
}
void TwxPropertyGrid::OnPropertyChanged(wxPropertyGridEvent& evt) void TwxPropertyGrid::OnPropertyChanged(wxPropertyGridEvent& evt)
{ {
TwxWindow* win = wxDynamicCast(GetParent(), TwxWindow); TwxWindow* win = wxDynamicCast(GetParent(), TwxWindow);

View File

@ -68,6 +68,10 @@ bool TwxPDFDC::StartDoc( const wxString& message )
GetFontsFolder(lpszFontPath, _MAX_PATH); GetFontsFolder(lpszFontPath, _MAX_PATH);
strFontPath.UngetWriteBuf(); strFontPath.UngetWriteBuf();
m_PDFlib->PDF_set_parameter(m_p, "SearchPath", strFontPath); m_PDFlib->PDF_set_parameter(m_p, "SearchPath", strFontPath);
const wxString strUser = wxGetUserId();
m_PDFlib->PDF_set_info(m_p, "Author", strUser);
m_PDFlib->PDF_set_info(m_p, "Creator", "Campo");
} }
PDF_CATCH_DL(m_PDFlib, m_p) PDF_CATCH_DL(m_PDFlib, m_p)
{ {

View File

@ -12,7 +12,7 @@ struct PDF_c {};
class TwxPDFDC : public wxDC class TwxPDFDC : public wxDC
{ {
enum { PDF_IMG_CACHE_SIZE = 4 }; enum { PDF_IMG_CACHE_SIZE = 13 };
protected: protected:
TwxPDFDC(); // Dummy constructor for dynamic construction TwxPDFDC(); // Dummy constructor for dynamic construction