archives.cpp Tolto include windows.h
checks.cpp Tolto include windows.h colors.cpp Tolto include windows.h controls.cpp Aggiunto cambiamento del font runtime dei TText_control execp.cpp Tolto include windows.h form.cpp Tolto include windows.h mask.cpp Corretta formattazione di due righe maskfld.cpp Aggiunto messaggio CHECK msksheet.cpp Tolto include windows.h relapp.cpp Tolto include windows.h strings.pp Corretto CHECK della TFixed_string::format() viswin.cpp Tolto include windows.h window.cpp Tolto include windows.h xvtility.cpp Corretto calcolo altezza righe delle maschere git-svn-id: svn://10.65.10.50/trunk@4085 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
685df10815
commit
55a36762ef
@ -1,8 +1,9 @@
|
||||
#define STRICT
|
||||
#include <windows.h>
|
||||
#include <direct.h>
|
||||
|
||||
#include <al.h>
|
||||
|
||||
#define XVT_INCL_NATIVE
|
||||
#define STRICT
|
||||
|
||||
#include <archives.h>
|
||||
#include <config.h>
|
||||
#include <isam.h>
|
||||
|
@ -3,13 +3,11 @@
|
||||
#include <stdlib.h>
|
||||
|
||||
#ifdef XVT
|
||||
#ifndef XVT_INCL_XVT
|
||||
#define XVT_INCL_NATIVE
|
||||
#define STRICT
|
||||
#include <xvt.h>
|
||||
#endif
|
||||
|
||||
#if XVT_OS == XVT_OS_WIN
|
||||
#define STRICT
|
||||
#include <windows.h>
|
||||
#include <keys.h>
|
||||
#else
|
||||
#include <xvtility.h>
|
||||
|
@ -1,11 +1,12 @@
|
||||
#if XVT_OS == XVT_OS_WIN
|
||||
#define XVT_INCL_NATIVE
|
||||
#define STRICT
|
||||
#include <windows.h>
|
||||
#include <commdlg.h>
|
||||
#endif
|
||||
|
||||
#include <colors.h>
|
||||
|
||||
#if XVT_OS == XVT_OS_WIN
|
||||
#include <commdlg.h>
|
||||
#endif
|
||||
|
||||
COLOR RGB2COLOR(unsigned char red, unsigned char green, unsigned char blue)
|
||||
{
|
||||
COLOR def = MAKE_COLOR(red, green, blue);
|
||||
|
@ -1,6 +1,6 @@
|
||||
#if XVT_OS == XVT_OS_WIN
|
||||
#define STRICT
|
||||
#include <windows.h>
|
||||
#define XVT_INCL_NATIVE
|
||||
#endif
|
||||
|
||||
#include <colors.h>
|
||||
@ -8,7 +8,6 @@
|
||||
#include <controls.h>
|
||||
#include <mask.h>
|
||||
#include <urldefid.h>
|
||||
#include <window.h>
|
||||
|
||||
COLOR MASK_BACK_COLOR = COLOR_DKCYAN;
|
||||
COLOR MASK_LIGHT_COLOR = COLOR_CYAN;
|
||||
@ -36,6 +35,11 @@ typedef struct _stx_data
|
||||
unsigned long attrib;
|
||||
} STX_DATA;
|
||||
|
||||
extern "C"
|
||||
{
|
||||
#include <xiutils.h>
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
HIDDEN bool _button_blocked = FALSE;
|
||||
@ -153,14 +157,20 @@ XVT_FNTID xvt_default_font(bool bold)
|
||||
TEXTMETRIC tm;
|
||||
HDC hdc = (HDC)xvt_vobj_get_attr(TASK_WIN, ATTR_NATIVE_GRAPHIC_CONTEXT);
|
||||
GetTextMetrics(hdc, &tm);
|
||||
|
||||
RCT pc; xvt_vobj_get_client_rect(TASK_WIN, &pc);
|
||||
|
||||
const int COLX = GetSystemMetrics(SM_CXSCREEN) / 80;
|
||||
ROWY = (pc.bottom - pc.top) / 23;
|
||||
const int COLX = (pc.right - pc.left) / 80;
|
||||
|
||||
CHARX = tm.tmAveCharWidth+1;
|
||||
if (CHARX > COLX) CHARX = COLX;
|
||||
if (CHARX > COLX)
|
||||
CHARX = COLX;
|
||||
|
||||
CHARY = tm.tmHeight;
|
||||
BASEY = tm.tmAscent;
|
||||
if (CHARY > ROWY-2) CHARY = ROWY-2;
|
||||
if (CHARY > ROWY-2)
|
||||
CHARY = ROWY-2;
|
||||
#endif
|
||||
}
|
||||
|
||||
@ -1018,7 +1028,12 @@ void TText_control::set_caption(const char* text)
|
||||
COLOR color;
|
||||
const char* c = parse_caption(text, bold, color);
|
||||
xi_set_text(_obj, (char*)c);
|
||||
_obj->v.text->fore_color = color;
|
||||
_obj->v.text->fore_color = color;
|
||||
|
||||
FONT_OBJ* &font = _obj->v.text->font;
|
||||
if (font == NULL)
|
||||
font = (FONT_OBJ*)xi_tree_malloc(sizeof(FONT_OBJ), _obj->v.text);
|
||||
*font = xi_create_copy_font_id(get_interface(), xvt_default_font(bold), NULL);
|
||||
}
|
||||
|
||||
|
||||
|
@ -1,4 +1,7 @@
|
||||
#include <stdio.h>
|
||||
|
||||
#define XVT_INCL_NATIVE
|
||||
#define STRICT
|
||||
#include <xvt.h>
|
||||
|
||||
#if XVT_OS == XVT_OS_SCOUNIX
|
||||
@ -7,8 +10,6 @@
|
||||
#endif
|
||||
|
||||
#if XVT_OS == XVT_OS_WIN
|
||||
#define STRICT
|
||||
#include <windows.h>
|
||||
#include <toolhelp.h>
|
||||
#include <hlapi_c.h>
|
||||
#endif
|
||||
|
@ -1,10 +1,8 @@
|
||||
#include <ctype.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#if XVT_OS == XVT_OS_WIN || XVT_OS == XVT_OS_NT
|
||||
#define STRICT
|
||||
#include <windows.h>
|
||||
#endif
|
||||
#define XVT_INCL_NATIVE
|
||||
|
||||
#include <applicat.h>
|
||||
#include <form.h>
|
||||
|
@ -1,11 +1,8 @@
|
||||
#include <time.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#if XVT_OS == XVT_OS_WIN || XVT_OS == XVT_OS_NT
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#define XVT_INCL_NATIVE
|
||||
#define STRICT
|
||||
#include <windows.h>
|
||||
#endif
|
||||
|
||||
#include <applicat.h>
|
||||
#include <controls.h>
|
||||
@ -482,8 +479,8 @@ bool TMask::check_fields()
|
||||
|
||||
void TMask::check_field( short fld_id )
|
||||
{
|
||||
field( fld_id ).on_hit();
|
||||
field( fld_id ).check();
|
||||
field(fld_id).on_hit();
|
||||
field(fld_id).check();
|
||||
}
|
||||
|
||||
// @doc EXTERNAL
|
||||
|
@ -273,8 +273,16 @@ void TMask_field::construct(TScanner& scanner, WINDOW parent)
|
||||
NFCHECK("Testata errata o BEGIN mancante nel campo %d", _ctl_data._dlg);
|
||||
scanner.push();
|
||||
}
|
||||
if (_ctl_data._dlg > 0 && mask().id2pos(_ctl_data._dlg) >= 0)
|
||||
NFCHECK("Esistono due campi con identificatore %d", _ctl_data._dlg);
|
||||
if (_ctl_data._dlg > 0)
|
||||
{
|
||||
const TMask& m = mask();
|
||||
for (int f = m.fields()-1; f >= 0; f--)
|
||||
{
|
||||
const TMask_field& mf = m.fld(f);
|
||||
if (mf.dlg() == _ctl_data._dlg && mf.parent() == parent)
|
||||
NFCHECK("Esistono due campi con identificatore %d", _ctl_data._dlg);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
while(scanner.popkey() != "EN") // END of control
|
||||
@ -767,26 +775,27 @@ HIDDEN void run_app(TMask& mask, TToken_string& msg)
|
||||
// Certified 90%
|
||||
bool TOperable_field::do_message(int num)
|
||||
{
|
||||
const int MAX_CMD = 17;
|
||||
const int MAX_CMD = 18;
|
||||
static const char* commands[MAX_CMD] =
|
||||
{
|
||||
"ADD", // 0
|
||||
"CLEAR", // 1
|
||||
"CO", // 2
|
||||
"DEL", // 3
|
||||
"DIRTY", // 4
|
||||
"DISABLE", // 5
|
||||
"ENABLE", // 6
|
||||
"ENABLEDEF", // 7
|
||||
"EXIT", // 8
|
||||
"HIDE", // 9
|
||||
"NORMAL", // 10
|
||||
"PUSH", // 11
|
||||
"REQUIRED", // 12
|
||||
"RESET", // 13
|
||||
"RU", // 14
|
||||
"SHOW", // 15
|
||||
"TAB", // 16
|
||||
"CH", // 1
|
||||
"CLEAR", // 2
|
||||
"CO", // 3
|
||||
"DEL", // 4
|
||||
"DIRTY", // 5
|
||||
"DISABLE", // 6
|
||||
"ENABLE", // 7
|
||||
"ENABLEDEF", // 8
|
||||
"EXIT", // 9
|
||||
"HIDE", // 10
|
||||
"NORMAL", // 11
|
||||
"PUSH", // 12
|
||||
"REQUIRED", // 13
|
||||
"RESET", // 14
|
||||
"RU", // 15
|
||||
"SHOW", // 16
|
||||
"TAB", // 17
|
||||
};
|
||||
|
||||
TToken_string* mess = message(num);
|
||||
@ -822,12 +831,12 @@ bool TOperable_field::do_message(int num)
|
||||
}
|
||||
}
|
||||
|
||||
if (cmd == 8)
|
||||
if (cmd == 9)
|
||||
{
|
||||
mask().stop_run(atoi(dlg));
|
||||
continue;
|
||||
} else
|
||||
if (cmd == 14)
|
||||
if (cmd == 15)
|
||||
{
|
||||
run_app(mask(), msg);
|
||||
continue;
|
||||
@ -837,40 +846,46 @@ bool TOperable_field::do_message(int num)
|
||||
const bool broadcast = dlg && strchr(dlg, '@');
|
||||
if (broadcast) fld = -fld;
|
||||
|
||||
if (value[0] == '"') value = value.strip("\"'");
|
||||
if (value[0] == '"')
|
||||
value = value.strip("\"'");
|
||||
else switch (cmd)
|
||||
{
|
||||
case 0:
|
||||
modify_list(TRUE, mask().field(fld), msg); continue;
|
||||
modify_list(TRUE, mask().field(fld), msg);
|
||||
continue;
|
||||
case 1:
|
||||
mask().field(fld).set_dirty();
|
||||
mask().field(fld).on_key(K_TAB);
|
||||
continue;
|
||||
case 2:
|
||||
mask().disable(fld);
|
||||
mask().reset(fld);
|
||||
continue;
|
||||
case 2:
|
||||
value = copy_value(msg, get()); break;
|
||||
case 3:
|
||||
modify_list(FALSE, mask().field(fld), msg); continue;
|
||||
value = copy_value(msg, get()); break;
|
||||
case 4:
|
||||
mask().field(fld).set_dirty(); continue;
|
||||
modify_list(FALSE, mask().field(fld), msg); continue;
|
||||
case 5:
|
||||
mask().disable(fld); continue;
|
||||
mask().field(fld).set_dirty(); continue;
|
||||
case 6:
|
||||
mask().enable(fld); continue;
|
||||
mask().disable(fld); continue;
|
||||
case 7:
|
||||
mask().enable(fld); continue;
|
||||
case 8:
|
||||
mask().enable_default(fld); continue;
|
||||
case 9:
|
||||
mask().hide(fld); continue;
|
||||
case 10:
|
||||
mask().field(fld).check_type(CHECK_NORMAL); continue;
|
||||
mask().hide(fld); continue;
|
||||
case 11:
|
||||
mask().field(fld).on_hit(); continue;
|
||||
mask().field(fld).check_type(CHECK_NORMAL); continue;
|
||||
case 12:
|
||||
mask().field(fld).check_type(CHECK_REQUIRED); continue;
|
||||
mask().field(fld).on_hit(); continue;
|
||||
case 13:
|
||||
mask().field(fld).check_type(CHECK_REQUIRED); continue;
|
||||
case 14:
|
||||
key = K_F2; break;
|
||||
case 15:
|
||||
mask().show(fld); continue;
|
||||
case 16:
|
||||
mask().show(fld); continue;
|
||||
case 17:
|
||||
mask().field(fld).on_key(K_TAB); continue;
|
||||
default:
|
||||
key = atoi(value);
|
||||
@ -2921,15 +2936,31 @@ bool TEdit_field::on_key(KEY key)
|
||||
if (_browse) k = _browse->run();
|
||||
else beep();
|
||||
|
||||
if (k != K_F9) set_focus();
|
||||
if (k != K_F9)
|
||||
set_focus();
|
||||
|
||||
if (k == K_ENTER)
|
||||
{
|
||||
set_dirty();
|
||||
if (on_hit())
|
||||
bool ok = TRUE;
|
||||
|
||||
set_dirty();
|
||||
// Controlla i validate che non vengono fatti da on_hit
|
||||
const int vf = validate_func();
|
||||
if (vf >= 0 && vf != AUTOEXIT_FUNC && vf != NUMCALC_FUNC &&
|
||||
vf != STRCALC_FUNC && vf != 21)
|
||||
{
|
||||
ok = validate(K_TAB);
|
||||
if (!ok && has_warning())
|
||||
default_error_box();
|
||||
}
|
||||
|
||||
// Esegue handler
|
||||
if (ok)
|
||||
ok = on_hit();
|
||||
|
||||
if (ok)
|
||||
{
|
||||
TMask & m = mask();
|
||||
|
||||
if (m.is_running())
|
||||
{
|
||||
set_focusdirty(FALSE); // Evita doppia esecuzione handlers!
|
||||
@ -2942,7 +2973,7 @@ bool TEdit_field::on_key(KEY key)
|
||||
}
|
||||
}
|
||||
}
|
||||
return TRUE;
|
||||
return ok;
|
||||
}
|
||||
else
|
||||
return FALSE;
|
||||
|
@ -1,15 +1,10 @@
|
||||
#define XI_INTERNAL
|
||||
#include <xi.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
extern "C"
|
||||
{
|
||||
#include <xiutils.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#include <colors.h>
|
||||
#include <config.h>
|
||||
|
@ -3,13 +3,10 @@
|
||||
#include <urldefid.h>
|
||||
#include <relapp.h>
|
||||
#include <utility.h>
|
||||
#define STRICT
|
||||
#define XVT_INCL_NATIVE
|
||||
#include <xvtility.h>
|
||||
|
||||
#if XVT_OS == XVT_OS_WIN
|
||||
#include <windows.h>
|
||||
#endif
|
||||
#define XVT_INCL_NATIVE
|
||||
#define STRICT
|
||||
#include <xvtility.h>
|
||||
|
||||
///////////////////////////////////////////////////////////
|
||||
// TRelation_application
|
||||
|
@ -874,7 +874,7 @@ TString& TFixed_string::format(
|
||||
va_start(pars, fmt);
|
||||
const int tot = vsprintf(_str, fmt, pars);
|
||||
va_end(pars);
|
||||
CHECK(tot >= 0 && tot < size(), "Ue'! Quanto scrivi con 'sta format?");
|
||||
CHECK(tot >= 0 && tot <= size(), "Ue'! Quanto scrivi con 'sta format?");
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
@ -1,3 +1,6 @@
|
||||
#define XVT_INCL_NATIVE
|
||||
#define STRICT
|
||||
|
||||
#include <browfile.h>
|
||||
#include <colors.h>
|
||||
#include <config.h>
|
||||
@ -25,11 +28,6 @@ const int PRINT_HEIGHT = 10;
|
||||
#define DLG_LINK_TITLE "Colle~ga"
|
||||
#define DLG_PRINT_TITLE "~Stampa"
|
||||
|
||||
#if XVT_OS == XVT_OS_WIN
|
||||
#define STRICT
|
||||
#include <windows.h>
|
||||
#endif
|
||||
|
||||
#define BACKGROUND (_toplevel ? MASK_BACK_COLOR : COLOR_GRAY)
|
||||
#define FOREGROUND (_toplevel ? COLOR_BLACK : COLOR_WHITE)
|
||||
|
||||
|
@ -1,9 +1,9 @@
|
||||
#define XVT_INCL_NATIVE
|
||||
#define STRICT
|
||||
|
||||
#define XI_INTERNAL
|
||||
#include <xi.h>
|
||||
|
||||
#define XVT_INCL_NATIVE
|
||||
#include <applicat.h>
|
||||
#include <checks.h>
|
||||
#include <urldefid.h>
|
||||
@ -13,11 +13,6 @@
|
||||
#include <window.h>
|
||||
#include <colors.h>
|
||||
|
||||
#if XVT_OS == XVT_OS_WIN || XVT_OS == XVT_OS_NT
|
||||
#include <windows.h>
|
||||
#endif
|
||||
|
||||
|
||||
HIDDEN MENU_ITEM* find_menu_item(MENU_ITEM* menu, MENU_TAG id, bool ismbar)
|
||||
{
|
||||
MENU_ITEM* fnd = NULL;
|
||||
|
@ -1,3 +1,5 @@
|
||||
#define XVT_INCL_NATIVE
|
||||
|
||||
#include <applicat.h>
|
||||
#include <colors.h>
|
||||
#include <config.h>
|
||||
@ -27,8 +29,6 @@ BOOLEAN error_hook(XVT_ERRMSG err, DATA_PTR)
|
||||
|
||||
#if XVT_OS == XVT_OS_WIN
|
||||
|
||||
#include <windows.h>
|
||||
|
||||
#ifndef ATTR_WIN_USE_CTL3D
|
||||
#include <ctl3d.h>
|
||||
#endif
|
||||
@ -43,7 +43,7 @@ BOOLEAN error_hook(XVT_ERRMSG err, DATA_PTR)
|
||||
extern "C" { WINDOW xvtwi_hwnd_to_window(HWND); }
|
||||
|
||||
short CHARX = 8;
|
||||
short ROWY = GetSystemMetrics(SM_CYSCREEN) / 25;
|
||||
short ROWY = -GetSystemMetrics(SM_CYSCREEN) / 25; // Not so good!
|
||||
short CHARY = 14;
|
||||
short BASEY = 12;
|
||||
|
||||
@ -275,8 +275,8 @@ RCT& resize_rect(
|
||||
WIN_TYPE wt, // @parm Tipo di controllo da creare
|
||||
WINDOW parent) // @parm Identificatore della finestra padre
|
||||
{
|
||||
static RCT r;
|
||||
|
||||
static RCT r;
|
||||
|
||||
if (parent != TASK_WIN)
|
||||
{
|
||||
if (xvt_vobj_get_type(parent) == W_PLAIN) // Mask with Toolbar
|
||||
@ -297,6 +297,14 @@ RCT& resize_rect(
|
||||
}
|
||||
wt = WC_EDIT;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (ROWY <= 0) // Not yet initialized
|
||||
{
|
||||
RCT pc; xvt_vobj_get_client_rect(TASK_WIN, &pc);
|
||||
ROWY = (pc.bottom - pc.top) / 23;
|
||||
}
|
||||
}
|
||||
|
||||
switch (wt)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user