Aggiunto menu font

git-svn-id: svn://10.65.10.50/trunk@2800 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
alex 1996-05-14 09:58:45 +00:00
parent c56df40925
commit 565b421b0f
2 changed files with 42 additions and 20 deletions

View File

@ -3,3 +3,4 @@
MENU TASK_MENUBAR MENU TASK_MENUBAR
SUBMENU MENU_FILE "~File" SUBMENU MENU_FILE "~File"
DEFAULT_FONT_MENU

View File

@ -1,16 +1,15 @@
#include <stdlib.h>
#define STRICT
#define XVT_INCL_NATIVE
#include <xvt.h> #include <xvt.h>
#include <stdlib.h> #include <stdlib.h>
#if XVT_OS == XVT_OS_WIN #if XVT_OS == XVT_OS_WIN
#define STRICT # include <toolhelp.h>
#include <windows.h>
#include <toolhelp.h>
#endif #endif
#include <extcdecl.h>
#include <modaut.h>
#include <applicat.h> #include <applicat.h>
#include <colors.h> #include <colors.h>
#include <config.h> #include <config.h>
@ -18,10 +17,13 @@
#include <prefix.h> #include <prefix.h>
#include <printer.h> #include <printer.h>
#include <progind.h> #include <progind.h>
#include <extcdecl.h>
#include <modaut.h>
#include <relation.h> #include <relation.h>
#include <urldefid.h> #include <urldefid.h>
#include <utility.h> #include <utility.h>
#include <xvtility.h> #include <xvtility.h>
#include <controls.h>
#include <bagn002.h> #include <bagn002.h>
@ -69,7 +71,7 @@ HIDDEN long backdrop_eh( WINDOW win, EVENT* ep)
HIDDEN void create_backdrop( void ) HIDDEN void create_backdrop( void )
{ {
#if XVT_OS == XVT_OS_WIN #if XVT_OS == XVT_OS_WIN || XVT_OS == XVT_OS_NT
xvt_create_statbar(); xvt_create_statbar();
xvt_statbar_set(""); xvt_statbar_set("");
#else #else
@ -171,11 +173,21 @@ long XVT_CALLCONV1 TApplication::task_eh(WINDOW win, EVENT *ep)
do_events(); do_events();
break; break;
#if XVT_OS == XVT_OS_WIN #if XVT_OS == XVT_OS_WIN || XVT_OS == XVT_OS_NT
case E_UPDATE: case E_UPDATE:
backdrop_eh(win, ep); backdrop_eh(win, ep);
break; break;
#endif #endif
case E_FONT:
{
XVT_FNTID new_font = ep->v.font.font_id;
char font_ser_desc[512];
TConfig font(CONFIG_USER, "Font");
xvt_font_serialize(new_font, font_ser_desc, sizeof(font_ser_desc));
font.set("FontDesc", font_ser_desc);
}
break;
default: default:
break; break;
} }
@ -308,7 +320,9 @@ void TApplication::terminate()
const word WM_WAKEUP = RegisterWindowMessage("WAKEUP"); const word WM_WAKEUP = RegisterWindowMessage("WAKEUP");
const HTASK ht = GetCurrentTask(); const HTASK ht = GetCurrentTask();
SendMessage(HWND_BROADCAST, WM_WAKEUP, (unsigned int)ht, 0L); SendMessage(HWND_BROADCAST, WM_WAKEUP, (unsigned int)ht, 0L);
#endif
#if XVT_OS == XVT_OS_WIN || XVT_OS == XVT_OS_NT
if (fexist("prassi.hlp")) if (fexist("prassi.hlp"))
{ {
HWND hwnd = (HWND)xvt_vobj_get_attr(TASK_WIN, ATTR_NATIVE_WINDOW); HWND hwnd = (HWND)xvt_vobj_get_attr(TASK_WIN, ATTR_NATIVE_WINDOW);
@ -381,16 +395,19 @@ void TApplication::set_perms()
_user_aut.set(i); _user_aut.set(i);
} }
else else
{ {
TLocalisamfile users(LF_USER); if (use_files())
users.zero();
users.put("USERNAME", utente);
if (users.read() == NOERR)
{ {
const TString& aut = users.get("AUTSTR"); TLocalisamfile users(LF_USER);
for (int i = aut.len()-1; i > 0; i--)
_user_aut.set(i, aut[i] == 'X'); users.zero();
users.put("USERNAME", utente);
if (users.read() == NOERR)
{
const TString& aut = users.get("AUTSTR");
for (int i = aut.len()-1; i > 0; i--)
_user_aut.set(i, aut[i] == 'X');
}
} }
} }
} }
@ -420,7 +437,7 @@ void TApplication::check_parameters(
#endif #endif
} }
#if XVT_OS == XVT_OS_WIN #if XVT_OS == XVT_OS_WIN || XVT_OS == XVT_OS_NT
const long twin_style = WSF_ICONIZABLE | WSF_SIZE | WSF_CLOSE | WSF_MAXIMIZED; const long twin_style = WSF_ICONIZABLE | WSF_SIZE | WSF_CLOSE | WSF_MAXIMIZED;
xvt_vobj_set_attr(NULL_WIN,ATTR_WIN_PM_TWIN_STARTUP_STYLE, twin_style); xvt_vobj_set_attr(NULL_WIN,ATTR_WIN_PM_TWIN_STARTUP_STYLE, twin_style);
#endif #endif
@ -538,7 +555,7 @@ void TApplication::enable_menu_item(
void TApplication::dispatch_e_menu(MENU_TAG item) void TApplication::dispatch_e_menu(MENU_TAG item)
{ {
#if XVT_OS == XVT_OS_WIN #if XVT_OS == XVT_OS_WIN || XVT_OS == XVT_OS_NT
HWND w = (HWND)xvt_vobj_get_attr(TASK_WIN, ATTR_NATIVE_WINDOW); HWND w = (HWND)xvt_vobj_get_attr(TASK_WIN, ATTR_NATIVE_WINDOW);
PostMessage(w, WM_COMMAND, item, 0L); PostMessage(w, WM_COMMAND, item, 0L);
#else #else
@ -710,10 +727,11 @@ bool TApplication::firm_change_enabled() const
// @comm Praticamente controlla se e' stato lanciato da ba0 o dal program manager // @comm Praticamente controlla se e' stato lanciato da ba0 o dal program manager
{ {
#if XVT_OS == XVT_OS_WIN #if XVT_OS == XVT_OS_WIN || XVT_OS == XVT_OS_NT
static bool can = 2; static bool can = 2;
if (can == 2) if (can == 2)
{ {
#if XVT_OS == XVT_OS_WIN
TASKENTRY te; te.dwSize = sizeof(TASKENTRY); TASKENTRY te; te.dwSize = sizeof(TASKENTRY);
HTASK ct = GetCurrentTask(); HTASK ct = GetCurrentTask();
TaskFindHandle(&te, ct); TaskFindHandle(&te, ct);
@ -724,6 +742,9 @@ bool TApplication::firm_change_enabled() const
stricmp(te.szModule, "MSVC") == 0 || stricmp(te.szModule, "MSVC") == 0 ||
#endif #endif
stricmp(te.szModule, "PROGMAN") == 0; stricmp(te.szModule, "PROGMAN") == 0;
#else
can = TRUE;
#endif
} }
return can; return can;
#else #else