Patch level : 2.0 nopatch

Files correlati     : xvaga.dll
Ricompilazione Demo : [ ]
Commento            :

Utilizzato nome applicazione come titolo documento di stampa
al posto della parola "Printout" proposta come standard


git-svn-id: svn://10.65.10.50/trunk@11287 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
guy 2003-06-26 09:33:13 +00:00
parent 5d08c914e1
commit 9460e73d9a
3 changed files with 19 additions and 21 deletions

View File

@ -32,7 +32,8 @@ XVT_CONFIG* _config_ = NULL;
wxWindow* _task_win = NULL;
wxWindow* _mouse_trapper = NULL;
RCT _startup_rect = { 0,0,0,0 };
wxString* _startup_dir = NULL;
wxString* _startup_dir = NULL;
wxString _strDefaultStatbarText;
static wxHashTable _nice_windows;
static wxHashTable _nice_icons;
@ -1478,16 +1479,11 @@ BOOLEAN xvt_dongle_sl_write_block(unsigned short reg, unsigned short size, const
// Common dialogs
///////////////////////////////////////////////////////////
static wxString GetMainTitle()
wxString _GetAppTitle()
{
wxString strTitle;
if (_task_win != NULL)
{
strTitle = _task_win->GetTitle();
const int space = strTitle.Find(" -");
if (space > 0)
strTitle = strTitle.Left(space);
}
if (_config_ != NULL)
strTitle = _config_->appl_name;
else
strTitle = "CAMPO";
return strTitle;
@ -1529,13 +1525,13 @@ ASK_RESPONSE xvt_dm_post_ask(const char* Btn1, const char*Btn2, const char* Btn3
else
nFlags |= wxCANCEL;
int answer = wxMessageBox(fmt, GetMainTitle(), nFlags);
int answer = wxMessageBox(fmt, _GetAppTitle(), nFlags);
return answer == wxYES ? RESP_DEFAULT : (answer == wxNO ? RESP_2 : RESP_3);
}
void xvt_dm_post_error(const char *fmt)
{
wxMessageBox(fmt, GetMainTitle(), wxOK | wxCENTRE | wxICON_ERROR);
wxMessageBox(fmt, _GetAppTitle(), wxOK | wxCENTRE | wxICON_ERROR);
}
void xvt_dm_post_fatal_exit(const char *fmt)
@ -1608,12 +1604,12 @@ BOOLEAN xvt_dm_post_font_sel(WINDOW win, XVT_FNTID font_id, PRINT_RCD *precp, un
void xvt_dm_post_message(const char *fmt)
{
wxMessageBox(fmt, GetMainTitle(), wxOK | wxCENTRE | wxICON_INFORMATION);
wxMessageBox(fmt, _GetAppTitle(), wxOK | wxCENTRE | wxICON_INFORMATION);
}
void xvt_dm_post_note(const char *fmt)
{
wxMessageBox(fmt, GetMainTitle(), wxOK | wxCENTRE | wxICON_EXCLAMATION);
wxMessageBox(fmt, _GetAppTitle(), wxOK | wxCENTRE | wxICON_EXCLAMATION);
}
char* xvt_dm_post_string_prompt(const char* message, char* response, int response_len)
@ -1626,7 +1622,7 @@ char* xvt_dm_post_string_prompt(const char* message, char* response, int respons
void xvt_dm_post_warning(const char *fmt)
{
wxMessageBox(fmt, GetMainTitle(), wxOK | wxCENTRE | wxICON_EXCLAMATION);
wxMessageBox(fmt, _GetAppTitle(), wxOK | wxCENTRE | wxICON_EXCLAMATION);
}
///////////////////////////////////////////////////////////
@ -1906,8 +1902,9 @@ void xvt_dwin_clear(WINDOW win, COLOR col)
{
CAST_DC(win, dc);
CAST_COLOR(col, brush_color);
wxBrush brush(brush_color, wxSOLID);
dc.SetBackground(brush);
wxBrush* brush = wxTheBrushList->FindOrCreateBrush(brush_color, wxSOLID);
dc.SetBackground(*brush);
dc.Clear();
}
@ -4331,15 +4328,13 @@ void xvt_win_trap_pointer(WINDOW win)
// Status bar
///////////////////////////////////////////////////////////
static wxString strDefaultStatbarText;
const char* statbar_set_title(WINDOW win, const char* text)
{
XVT_ASSERT(win == TASK_WIN);
wxFrame& w = *(wxFrame*)win;
if (text == NULL)
text = strDefaultStatbarText;
text = _strDefaultStatbarText;
char* tab = strchr(text, '\t');
if (tab)
{
@ -4355,8 +4350,8 @@ const char* statbar_set_title(WINDOW win, const char* text)
const char* statbar_set_default_title(WINDOW win, const char *text)
{
strDefaultStatbarText = text;
return statbar_set_title(win, strDefaultStatbarText);
_strDefaultStatbarText = text;
return statbar_set_title(win, _strDefaultStatbarText);
}
XVT_FNTID statbar_set_fontid(WINDOW win, XVT_FNTID fontid)

View File

@ -82,4 +82,6 @@ public:
virtual ~TPrintDC();
};
wxString _GetAppTitle();
#endif

View File

@ -113,6 +113,7 @@ void TwxPrintOut::InitDC(TPRINT_RCD* prcd)
}
TwxPrintOut::TwxPrintOut(TPRINT_RCD* prcd)
: wxPrintout(_GetAppTitle())
{
InitDC(prcd);
}