applicat.cpp Corretta dimensione finestra principale in Windows 95
utility.cpp Aggiuta funzione get_os_type utility.h Aggiunta funzione get_os_type ed enum os_type xvtility.cpp Aggiunta funzione set_xvt_hooks xvtility/h Aggiunta funzione set_xvt_hooks git-svn-id: svn://10.65.10.50/trunk@4075 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
c370e00c8d
commit
c99ad845d3
@ -162,16 +162,7 @@ long XVT_CALLCONV1 TApplication::task_eh(WINDOW win, EVENT *ep)
|
|||||||
TString cap;
|
TString cap;
|
||||||
cap << prassi_spa() << " - " << main_app().get_module_name();
|
cap << prassi_spa() << " - " << main_app().get_module_name();
|
||||||
tw.set_caption(cap);
|
tw.set_caption(cap);
|
||||||
/*
|
|
||||||
#if XVT_OS == XVT_OS_WIN
|
|
||||||
HWND hwnd = (HWND)xvt_vobj_get_attr(win, ATTR_NATIVE_WINDOW);
|
|
||||||
RECT rect;
|
|
||||||
GetWindowRect(GetDesktopWindow(), &rect);
|
|
||||||
SetWindowPos(hwnd, (HWND) NULL, 0, 0,
|
|
||||||
rect.right, rect.bottom,
|
|
||||||
SWP_NOZORDER | SWP_NOACTIVATE);
|
|
||||||
#endif
|
|
||||||
*/
|
|
||||||
customize_controls(TRUE);
|
customize_controls(TRUE);
|
||||||
create_backdrop();
|
create_backdrop();
|
||||||
|
|
||||||
@ -514,15 +505,7 @@ void TApplication::run(
|
|||||||
cfg.appl_name = (char*)title;
|
cfg.appl_name = (char*)title;
|
||||||
cfg.taskwin_title = "PR.A.S.S.I.";
|
cfg.taskwin_title = "PR.A.S.S.I.";
|
||||||
|
|
||||||
xvt_vobj_set_attr(NULL_WIN,ATTR_WIN_PM_DRAWABLE_TWIN, TRUE);
|
set_xvt_hooks();
|
||||||
|
|
||||||
#if XVT_OS == XVT_OS_WIN || XVT_OS == XVT_OS_NT
|
|
||||||
const long twin_style = WSF_ICONIZABLE | WSF_CLOSE | WSF_SIZE | WSF_MAXIMIZED;
|
|
||||||
xvt_vobj_set_attr(NULL_WIN,ATTR_WIN_PM_TWIN_STARTUP_STYLE, twin_style);
|
|
||||||
#ifdef ATTR_WIN_USE_CTL3D
|
|
||||||
xvt_vobj_set_attr(NULL_WIN, ATTR_WIN_USE_CTL3D, TRUE);
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
_application = this;
|
_application = this;
|
||||||
xvt_app_create(argc, argv, 0L, task_eh, &cfg);
|
xvt_app_create(argc, argv, 0L, task_eh, &cfg);
|
||||||
|
@ -3,7 +3,9 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
#ifndef FOXPRO
|
#ifndef FOXPRO
|
||||||
|
#define STRICT
|
||||||
|
#define XVT_INCL_NATIVE
|
||||||
#include <xvt.h>
|
#include <xvt.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -415,29 +417,23 @@ const char * decode(
|
|||||||
return __tmp_string;
|
return __tmp_string;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if XVT_OS == XVT_OS_SCOUNIX
|
|
||||||
|
|
||||||
// @doc EXTERNAL
|
os_type get_os_type()
|
||||||
|
|
||||||
// @func Permette di confrontare due stringhe ignorando la differenza
|
|
||||||
// tra lettere maiuscole o minuscole
|
|
||||||
//
|
|
||||||
// @rdesc Ritorna il risultato dell'operazione:
|
|
||||||
//
|
|
||||||
// @flag 0 | Se le stringhe sono uguali
|
|
||||||
// @flag >0 | Se le stringhe sono differenti. Il numero indica la lettera diversa
|
|
||||||
int stricmp(
|
|
||||||
const char* s1, // @parm Prima stringa da confrontare
|
|
||||||
const char* s2) // @parm Seconda stringa da confrontare
|
|
||||||
{
|
{
|
||||||
for(int d = 0 ; (d = toupper(*s1)-toupper(*s2)) == 0; s1++, s2++)
|
#if XVT_OS == XVT_OS_WIN
|
||||||
if (*s1 == '\0' && *s2 == '\0')
|
const WORD winver = LOWORD(GetVersion());
|
||||||
return 0;
|
const BYTE majver = LOBYTE(winver);
|
||||||
return d;
|
const BYTE minver = HIBYTE(winver);
|
||||||
}
|
if (majver > 3 || (majver == 3 && minver > 11))
|
||||||
|
return os_Windows95;
|
||||||
|
const DWORD winflags = GetWinFlags();
|
||||||
|
if (winflags & 0x4000)
|
||||||
|
return os_WindowsNT;
|
||||||
|
return os_Windows;
|
||||||
|
#else
|
||||||
|
#error Ricordati di Win32
|
||||||
#endif
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef __WATCOMC__
|
#ifdef __WATCOMC__
|
||||||
|
|
||||||
|
@ -12,6 +12,9 @@ const char* itor(int i);
|
|||||||
bool fcopy(const char* orig, const char* dest, bool append=FALSE);
|
bool fcopy(const char* orig, const char* dest, bool append=FALSE);
|
||||||
bool fexist(const char* file);
|
bool fexist(const char* file);
|
||||||
|
|
||||||
|
enum os_type { os_Windows, os_Win32s, os_Windows95, os_WindowsNT };
|
||||||
|
os_type get_os_type();
|
||||||
|
|
||||||
bool make_dir(const char* file);
|
bool make_dir(const char* file);
|
||||||
int list_files(TToken_string& names);
|
int list_files(TToken_string& names);
|
||||||
const char * encode(const char* data);
|
const char * encode(const char* data);
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
#include <urldefid.h>
|
#include <urldefid.h>
|
||||||
#include <utility.h>
|
#include <utility.h>
|
||||||
|
|
||||||
#include <statbar.h>
|
#include <statbar.h>
|
||||||
|
|
||||||
#if XVT_OS == XVT_OS_SCOUNIX
|
#if XVT_OS == XVT_OS_SCOUNIX
|
||||||
extern "C" { long nap(long period); }
|
extern "C" { long nap(long period); }
|
||||||
@ -250,7 +250,7 @@ static BOOLEAN event_hook(HWND hwnd,
|
|||||||
dispatch_e_char(win, k);
|
dispatch_e_char(win, k);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
if (msg == WM_WAKEUP && wparam == main_app().waiting())
|
if (msg == WM_WAKEUP && wparam == main_app().waiting())
|
||||||
main_app().wake_up();
|
main_app().wake_up();
|
||||||
@ -585,6 +585,40 @@ void dispatch_e_scroll(
|
|||||||
|
|
||||||
if (w != SC_NONE)
|
if (w != SC_NONE)
|
||||||
dispatch_event(win, e, FALSE);
|
dispatch_event(win, e, FALSE);
|
||||||
|
}
|
||||||
|
|
||||||
|
void set_xvt_hooks()
|
||||||
|
{
|
||||||
|
xvt_vobj_set_attr(NULL_WIN,ATTR_ERRMSG_HANDLER, (long)error_hook);
|
||||||
|
xvt_vobj_set_attr(NULL_WIN,ATTR_WIN_PM_DRAWABLE_TWIN, TRUE);
|
||||||
|
|
||||||
|
#if XVT_OS == XVT_OS_WIN
|
||||||
|
xvt_vobj_set_attr(NULL_WIN,ATTR_EVENT_HOOK, (long)event_hook);
|
||||||
|
|
||||||
|
#ifdef ATTR_WIN_USE_CTL3D
|
||||||
|
xvt_vobj_set_attr(NULL_WIN, ATTR_WIN_USE_CTL3D, TRUE);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
long twin_style = WSF_ICONIZABLE | WSF_CLOSE | WSF_SIZE;
|
||||||
|
const int scx = GetSystemMetrics(SM_CXSCREEN);
|
||||||
|
if (scx == 640 && get_os_type() == os_Windows95)
|
||||||
|
{
|
||||||
|
const int scy = GetSystemMetrics(SM_CYSCREEN);
|
||||||
|
const int bcx = GetSystemMetrics(SM_CXFRAME);
|
||||||
|
const int bcy = GetSystemMetrics(SM_CYFRAME);
|
||||||
|
static RCT rct;
|
||||||
|
rct.left = -bcx;
|
||||||
|
rct.top = GetSystemMetrics(SM_CYCAPTION)-bcy-1;
|
||||||
|
rct.right = scx+bcx;
|
||||||
|
rct.bottom = scy+bcy;
|
||||||
|
xvt_vobj_set_attr(NULL_WIN, ATTR_WIN_PM_TWIN_STARTUP_RCT, long(&rct));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
twin_style |= WSF_MAXIMIZED;
|
||||||
|
|
||||||
|
xvt_vobj_set_attr(NULL_WIN,ATTR_WIN_PM_TWIN_STARTUP_STYLE, twin_style);
|
||||||
|
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
// @doc INTERNAL
|
// @doc INTERNAL
|
||||||
@ -592,16 +626,10 @@ void dispatch_e_scroll(
|
|||||||
// @func Stabilisce i parametri standard dei controlli
|
// @func Stabilisce i parametri standard dei controlli
|
||||||
void customize_controls(
|
void customize_controls(
|
||||||
bool on) // @parm Permette di inizializzare (TRUE) o scaricare (FALSE) i parametri
|
bool on) // @parm Permette di inizializzare (TRUE) o scaricare (FALSE) i parametri
|
||||||
|
|
||||||
{
|
{
|
||||||
if (on)
|
if (on)
|
||||||
{
|
{
|
||||||
#if XVT_OS == XVT_OS_WIN
|
#if XVT_OS == XVT_OS_WIN
|
||||||
long old_hook = xvt_vobj_get_attr(NULL_WIN,ATTR_EVENT_HOOK);
|
|
||||||
if (old_hook == 0)
|
|
||||||
xvt_vobj_set_attr(NULL_WIN,ATTR_EVENT_HOOK, (long)event_hook);
|
|
||||||
|
|
||||||
xvt_vobj_set_attr(NULL_WIN,ATTR_ERRMSG_HANDLER, (long)error_hook);
|
|
||||||
|
|
||||||
#ifndef ATTR_WIN_USE_CTL3D
|
#ifndef ATTR_WIN_USE_CTL3D
|
||||||
HInstance = (HINSTANCE)xvt_vobj_get_attr(NULL_WIN, ATTR_WIN_INSTANCE);
|
HInstance = (HINSTANCE)xvt_vobj_get_attr(NULL_WIN, ATTR_WIN_INSTANCE);
|
||||||
@ -610,6 +638,7 @@ void customize_controls(
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
customize_colors();
|
customize_colors();
|
||||||
init_controls();
|
init_controls();
|
||||||
}
|
}
|
||||||
|
@ -39,6 +39,7 @@ WINDOW xvt_create_window
|
|||||||
void beep();
|
void beep();
|
||||||
void do_events();
|
void do_events();
|
||||||
|
|
||||||
|
void set_xvt_hooks();
|
||||||
void customize_colors();
|
void customize_colors();
|
||||||
void customize_controls(bool on);
|
void customize_controls(bool on);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user