execp.cpp Mega correzione del metodo TExternal_app::run che ora

puo' attendere bene i programmi a 16 e a 32 bit!
form.cpp     Corretto metodo TForm::print per form TCursorless
sheet.cpp    Corretta larghezza colonne con intestazioni su piu' righe
strings.cpp  Corretti metodi TFilename::name() e TFilename::path()
xvtility.cpp Migliorata indentazione per facilitare il debug dei
             messaggi WM_WAKEUP


git-svn-id: svn://10.65.10.50/trunk@5724 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
guy 1997-12-11 15:40:11 +00:00
parent 29dc209df8
commit b88cceb3dd
5 changed files with 62 additions and 39 deletions

View File

@ -1,6 +1,6 @@
#include <stdio.h> #include <stdio.h>
#define STRICT //#define STRICT // Guai a me
#define XVT_INCL_NATIVE #define XVT_INCL_NATIVE
#include <xvt.h> #include <xvt.h>
@ -156,12 +156,23 @@ word TExternal_app::run(
TWait_cursor hourglass; TWait_cursor hourglass;
#if XVT_OS == XVT_OS_WIN #if XVT_OS == XVT_OS_WIN
HL_LOGOUT(); HL_LOGOUT();
_exitcode = WinExec(path.get_buffer(), show ? SW_SHOWNORMAL : SW_HIDE); _exitcode = WinExec((const char*)path, show ? SW_SHOWNORMAL : SW_HIDE);
if (_exitcode >= 32) if (_exitcode >= 32)
{ {
if (!async) if (!async)
{ {
const char* szModule = path.name();
HTASK child = NULL;
TASKENTRY te; te.dwSize = sizeof(TASKENTRY);
for (bool ok = TaskFirst(&te); ok; ok = TaskNext(&te))
if (te.hInst == (HINSTANCE)_exitcode ||
stricmp(te.szModule, szModule) == 0)
{
child = te.hTask;
break;
}
TTemp_window tw(TASK_WIN); TTemp_window tw(TASK_WIN);
if (iconize) if (iconize)
{ {
@ -169,15 +180,6 @@ word TExternal_app::run(
tw.deactivate(); tw.deactivate();
} }
HTASK child = NULL;
TASKENTRY te; te.dwSize = sizeof(TASKENTRY);
for (bool ok = TaskFirst(&te); ok; ok = TaskNext(&te))
if (te.hInst == (HINSTANCE)_exitcode)
{
child = te.hTask;
break;
}
// Warning! child could be NULL if you run that beast called Foxpro // Warning! child could be NULL if you run that beast called Foxpro
main_app().wait_for((word)child); main_app().wait_for((word)child);

View File

@ -4263,7 +4263,7 @@ bool TForm::genera_fincatura(
// //
// @rdesc Ritorna FALSE se non esiste body (o non e' COLUMNWISE) o se non esiste l'header // @rdesc Ritorna FALSE se non esiste body (o non e' COLUMNWISE) o se non esiste l'header
bool TForm::genera_intestazioni( bool TForm::genera_intestazioni(
pagetype p, // @parm Posizione della pgaina (vedi <t pagetype>) pagetype p, // @parm Posizione della pagina (vedi <t pagetype>)
short y) // @parm Riga dell'header in cui vanno inserite short y) // @parm Riga dell'header in cui vanno inserite
// @comm I form_items di intestazione vengono aggiunti alla sezione header di tipo <p p> con ID -1 // @comm I form_items di intestazione vengono aggiunti alla sezione header di tipo <p p> con ID -1
@ -4308,11 +4308,13 @@ bool TForm::genera_intestazioni(
break; break;
} }
} }
TParagraph_string prompts(fi.col_head().mid(align ? 2:0),fi.width());
// Paragraph_string has as many items as lines needed... // Paragraph_string has as many items as lines needed...
TParagraph_string prompts(fi.col_head().mid(align ? 2:0),fi.width());
TString p;
for (int c=0;c < prompts.items(); c++) for (int c=0;c < prompts.items(); c++)
{ {
TString p(prompts.get(c)); p = prompts.get(c);
switch (align) switch (align)
{ {
case 'c': case 'c':
@ -4497,15 +4499,19 @@ bool TForm::print(
for (long i = from; i <= to && ok;) for (long i = from; i <= to && ok;)
{ {
if (from < 0) to = from; if (from < 0)
to = from;
else if (cursor()) else if (cursor())
{
*cursor()=i; *cursor()=i;
match_result(); match_result();
}
if (pr.current_row() > pr.headersize()+1) if (pr.current_row() > pr.headersize()+1)
{ {
const word h = set_body(page(pr), FALSE); const word h = set_body(page(pr), FALSE);
if (h > pr.rows_left()) { if (h > pr.rows_left())
{
pr.formfeed(); pr.formfeed();
// quanto resta da stampare sta nell'ultima pagina // quanto resta da stampare sta nell'ultima pagina
if (!fixed_pages() && set_body(0,FALSE) * word(to-i+1) <= pr.formlen()- set_header(1,FALSE) - set_footer(0,FALSE)) if (!fixed_pages() && set_body(0,FALSE) * word(to-i+1) <= pr.formlen()- set_header(1,FALSE) - set_footer(0,FALSE))
@ -4527,12 +4533,15 @@ bool TForm::print(
} }
set_body(page(pr), TRUE); set_body(page(pr), TRUE);
if (cursor()) { if (cursor())
{
if (next_match_done()) if (next_match_done())
i=cursor()->pos(); i=cursor()->pos();
else else
i++; i++;
} }
else
i++;
} // fine ciclo di stampa } // fine ciclo di stampa
while (fixed_pages() && page(pr) % _npages !=0) while (fixed_pages() && page(pr) % _npages !=0)
@ -4541,6 +4550,7 @@ bool TForm::print(
pr.formfeed(); pr.formfeed();
pr.print(empty_line); pr.print(empty_line);
} }
if (from >= 0)
pr.formfeed(); pr.formfeed();
if (!was_open) if (!was_open)
pr.close(); pr.close();
@ -5315,19 +5325,20 @@ void TForm::set_compulsory_specials()
const char sc = sechar[sn]; const char sc = sechar[sn];
for (pagetype pt = odd_page; pt <= last_page; pt = pagetype(pt+1)) for (pagetype pt = odd_page; pt <= last_page; pt = pagetype(pt+1))
{ {
TPrint_section* sec = exist(sc, pt); const TPrint_section* sec = exist(sc, pt);
if (sec != NULL) if (sec != NULL && sec->columnwise())
{ {
const word fields = sec->fields(); const word fields = sec->fields();
const bool col_wise = sec->columnwise(); for (word i = 0; i < fields; i++)
for (word i = 0; col_wise && i < fields; i++)
{ {
TForm_item& fi = sec->field(i); TForm_item& fi = sec->field(i);
if (fi.special_items() > 0) if (fi.special_items() > 0)
{ {
fi.set_col_head(fi.get_special_value("INTESTAZIONE")); fi.set_col_head(fi.get_special_value("INTESTAZIONE"));
fi.ofs() = (short)atoi(fi.get_special_value("OFFSET")); fi.ofs() = (short)atoi(fi.get_special_value("OFFSET"));
TString fnk(fi.get_special_value("FINCATURA")); const TString& fnk = fi.get_special_value("FINCATURA");
if (fnk.not_empty())
{
fi.set_finkl(fnk[0]!='X'); // !finkl significa fincatura abilitata fi.set_finkl(fnk[0]!='X'); // !finkl significa fincatura abilitata
fi.set_finkr(fnk[1]!='X'); // !finkr significa fincatura abilitata fi.set_finkr(fnk[1]!='X'); // !finkr significa fincatura abilitata
} }
@ -5336,6 +5347,7 @@ void TForm::set_compulsory_specials()
} }
} }
} }
}
void TForm::get_compulsory_specials() void TForm::get_compulsory_specials()
{ {

View File

@ -165,7 +165,7 @@ TSheet_control::TSheet_control(
} }
testa.cut(at); testa.cut(at);
v = max(at, v); if (v == 0) v = at;
} }
if (v > 64) if (v > 64)

View File

@ -1002,23 +1002,29 @@ void TFilename::ext(const char* e)
} }
// Certified 90% // Certified 95%
const char* TFilename::name() const const char* TFilename::name() const
{ {
for (int i = strlen(_str)-1; i >= 0; i--) int start = find(' ')-1;
if (start < 0)
start = len()-1;
for (int i = start; i >= 0; i--)
if (_str[i] == '/' || _str[i] == '\\' || _str[i] == ':') if (_str[i] == '/' || _str[i] == '\\' || _str[i] == ':')
break; break;
return &_str[i+1]; spark.strncpy(&_str[i+1], start-i);
return spark;
} }
// Certified 90% // Certified 95%
const char* TFilename::path() const const char* TFilename::path() const
{ {
for (int i = strlen(_str)-1; i >= 0; i--) int start = find(' ')-1;
if (start < 0)
start = len()-1;
for (int i = start; i >= 0; i--)
if (_str[i] == '/' || _str[i] == '\\' || _str[i] == ':') if (_str[i] == '/' || _str[i] == '\\' || _str[i] == ':')
break; break;
spark.strncpy(_str, i+1); spark.strncpy(_str, i+1);
return spark; return spark;
} }

View File

@ -82,8 +82,11 @@ static BOOLEAN event_hook(HWND hwnd,
} }
break; break;
default: default:
if (msg == WM_WAKEUP && wparam == main_app().waiting()) if (msg == WM_WAKEUP)
{
if (wparam == main_app().waiting())
main_app().wake_up(); main_app().wake_up();
}
break; break;
} }