Patch level : 2.1 nopatch

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

Migliorata selezione font tramite xvt_dm_post_font_select


git-svn-id: svn://10.65.10.50/trunk@11901 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
guy 2004-03-23 16:41:20 +00:00
parent 7112dfd722
commit 7df1024793

View File

@ -1714,17 +1714,19 @@ BOOLEAN xvt_dm_post_font_sel(WINDOW win, XVT_FNTID font_id, PRINT_RCD *precp, un
TFontId& font = *(TFontId*)font_id; TFontId& font = *(TFontId*)font_id;
wxFontData data; wxFontData data;
data.SetInitialFont(font.Font(NULL, win)); data.SetInitialFont(font.Font(NULL, win));
data.EnableEffects(FALSE); data.EnableEffects(reserved != 0);
wxFontDialog dlg(_task_win, &data); wxFontDialog dlg(_task_win, &data);
BOOLEAN ok = dlg.ShowModal() == wxID_OK; BOOLEAN ok = dlg.ShowModal() == wxID_OK;
if (ok) if (ok)
{ {
font.Copy(dlg.GetFontData().GetChosenFont()); font.Copy(dlg.GetFontData().GetChosenFont());
if (win == (WINDOW)_task_win)
EVENT e; memset(&e, 0, sizeof(EVENT)); {
e.type = E_FONT; EVENT e; memset(&e, 0, sizeof(EVENT));
e.v.font.font_id = font_id; e.type = E_FONT;
_task_win_handler(win, &e); e.v.font.font_id = font_id;
_task_win_handler(win, &e);
}
} }
return ok; return ok;
} }
@ -1766,43 +1768,10 @@ struct XVAGA_HELP_INFO
{ {
wxString m_strFilename; wxString m_strFilename;
bool m_hlp; bool m_hlp;
// wxHtmlHelpController m_hc;
} help_info; } help_info;
XVT_HELP_INFO xvt_help_open_helpfile(FILE_SPEC *fs, unsigned long flags) XVT_HELP_INFO xvt_help_open_helpfile(FILE_SPEC *fs, unsigned long flags)
{ {
/*
if (!help_info.m_strFilename.IsEmpty())
xvt_help_close_helpfile((XVT_HELP_INFO)&help_info);
const char* ext[] = { ".zip", ".htb", ".hlp", NULL };
for (int j = 0; j < 2; j++)
{
wxString base = fs->name;
if (j == 1)
base.Replace("campo", "prassi", true);
for (int i = 0; ext[i]; i++)
{
wxString strName;
if (i < 2)
strName = "help/";
strName << base;
strName << ext[i];
if (::wxFileExists(strName))
{
help_info.m_strFilename = strName;
help_info.m_hlp = i == 2;
if (!help_info.m_hlp)
{
wxFileSystem::AddHandler(new wxZipFSHandler);
help_info.m_hc.AddBook(strName, true);
}
return (XVT_HELP_INFO)&help_info;
}
}
}
return NULL_HELP_INFO;
*/
return (XVT_HELP_INFO)&help_info; return (XVT_HELP_INFO)&help_info;
} }
@ -1810,82 +1779,12 @@ void xvt_help_close_helpfile(XVT_HELP_INFO hi)
{ {
if (hi == NULL_HELP_INFO) if (hi == NULL_HELP_INFO)
hi = (XVT_HELP_INFO)&help_info; hi = (XVT_HELP_INFO)&help_info;
/*
XVAGA_HELP_INFO* ahi = (XVAGA_HELP_INFO*)hi;
if (!ahi->m_strFilename.IsEmpty())
{
#ifdef WIN32
if (ahi->m_hlp)
{
unsigned int hwnd = (unsigned int)xvt_vobj_get_attr(TASK_WIN, ATTR_NATIVE_WINDOW);
OsWin32_Help(hwnd, ahi->m_strFilename, 0, NULL); // HELP_QUIT
}
#endif
if (!ahi->m_hlp)
ahi->m_hc.Quit();
ahi->m_strFilename.Empty();
}
*/
} }
BOOLEAN xvt_help_process_event(XVT_HELP_INFO hi, WINDOW win, EVENT *ev) BOOLEAN xvt_help_process_event(XVT_HELP_INFO hi, WINDOW win, EVENT *ev)
{ {
BOOLEAN bProcessed = FALSE; BOOLEAN bProcessed = FALSE;
/*
if (hi == NULL_HELP_INFO)
return bProcessed;
XVAGA_HELP_INFO* ahi = (XVAGA_HELP_INFO*)hi;
if (ahi->m_strFilename.IsEmpty())
return bProcessed;
#ifdef WIN32
if (ahi->m_hlp)
{
unsigned int hwnd = (unsigned int)xvt_vobj_get_attr(win, ATTR_NATIVE_WINDOW);
switch (ev->type)
{
case E_COMMAND:
bProcessed = OsWin32_Help(hwnd, ahi->m_strFilename, ev->v.cmd.tag, NULL);
break;
case E_HELP:
bProcessed = OsWin32_Help(hwnd, ahi->m_strFilename, M_HELP_ONCONTEXT, (const char*)ev->v.help.tid);
break;
default:
break;
}
return bProcessed;
}
#endif
switch (ev->type)
{
case E_COMMAND:
switch (ev->v.cmd.tag)
{
case M_HELP_CONTENTS:
ahi->m_hc.DisplayContents();
bProcessed = TRUE;
break;
case M_HELP_SEARCH:
ahi->m_hc.DisplayIndex();
bProcessed = TRUE;
break;
default:
break;
}
break;
case E_HELP:
ahi->m_hc.Display((const char*)ev->v.help.tid);
bProcessed = TRUE;
break;
default:
break;
}
*/
#ifdef WIN32 #ifdef WIN32
unsigned int hwnd = (unsigned int)xvt_vobj_get_attr(win, ATTR_NATIVE_WINDOW); unsigned int hwnd = (unsigned int)xvt_vobj_get_attr(win, ATTR_NATIVE_WINDOW);
switch (ev->type) switch (ev->type)
@ -1986,7 +1885,6 @@ bool TFontId::Underline() const
return (m_wMask & XVT_FS_UNDERLINE) != 0; return (m_wMask & XVT_FS_UNDERLINE) != 0;
} }
wxFont& TFontId::Font(wxDC* dc, WINDOW win) const wxFont& TFontId::Font(wxDC* dc, WINDOW win) const
{ {
int nSize = PointSize(); int nSize = PointSize();
@ -2002,7 +1900,7 @@ wxFont& TFontId::Font(wxDC* dc, WINDOW win) const
const int cpi = 120 / nSize; const int cpi = 120 / nSize;
const wxString str('M', cpi); const wxString str('M', cpi);
int nMin = 1, nMax = nSize*8; int nMin = 1, nMax = nSize*10;
int nBest = 0; int nBest = 0;
while (nMin <= nMax) while (nMin <= nMax)
{ {
@ -3107,6 +3005,7 @@ BOOLEAN xvt_menu_popup(MENU_ITEM *menu_p, WINDOW win, PNT pos,
else else
item = new wxMenuItem(&menu, mi->tag, mi->text, wxEmptyString, mi->checkable); item = new wxMenuItem(&menu, mi->tag, mi->text, wxEmptyString, mi->checkable);
menu.DoAppend(item); menu.DoAppend(item);
item->Enable(mi->enabled); // Fattibile solo dopo l'append
} }
CAST_WIN(win, w); CAST_WIN(win, w);
bool ok = w.PopupMenu(&menu, pos.h, pos.v); bool ok = w.PopupMenu(&menu, pos.h, pos.v);