anagiu.h Aggiunti campi

config.cpp   Aggiunta list_values
controls.cpp Allineati meglio i campi statici ed allargati  i bottoni
golem.cpp    Corretto TDDE
mailbox.cpp  Aggiunti const qua e la
mask.cpp     Corretto conteggio delle pagine


git-svn-id: svn://10.65.10.50/trunk@3012 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
guy 1996-06-18 13:33:27 +00:00
parent ffcea7e716
commit 7371da0e38
8 changed files with 68 additions and 42 deletions

View File

@ -1,7 +1,7 @@
#ifndef __ANAGIU_H
#define __ANAGIU_H
#define ANG_TIPOA "TIPOA"
#define ANG_CODANAGR "CODANAGR"
#define ANG_NATGIU "NATGIU"
#define ANG_COMRES "COMRES"

View File

@ -503,6 +503,12 @@ int TConfig::list_variables(TString_array& vl, bool value, const char* section)
return vl.items();
}
const TAssoc_array& TConfig::list_variables(const char* section)
{
set_paragraph(section);
return _data;
}
TConfig::TConfig(int which_config, const char* paragraph)
{

View File

@ -127,6 +127,10 @@ public:
// add_value e' TRUE ci mette "variabile<pipe>valore"
// ACHTUNG: l'array e' in ordine HASH (CAZZ)
int list_variables(TString_array& vl, bool add_value = FALSE, const char* section = NULL);
// @cmember Ritorna l'intero array delle variabili della sezione
// eventualmente specificata da <p section>
const TAssoc_array& list_variables(const char* section = NULL);
// @cmember Costruttore (il paragrafo iniziale e' il modulo corrente
// salvo diversa indicazione)

View File

@ -797,10 +797,6 @@ TText_control::TText_control(WINDOW win, short cid,
_obj = xi_create(get_interface(win), def);
CHECKS(_obj, "Can't create TText_control ", text);
// Alza di un pixel il rettangolo per allinearlo meglio agli edit field
RCT& tr = _obj->v.text->rct;
tr.top--; tr.bottom--;
xi_dequeue();
xi_tree_free(def);
}
@ -823,7 +819,11 @@ TGroupbox_control::TGroupbox_control(WINDOW win, short cid,
short left, short top, short width, short height,
const char* flags, const char* text)
: TText_control(win, cid, left, top, width, 1, flags, text)
{
{
// Alza di un pixel il rettangolo per non coprire il rettangolo
RCT& tr = _obj->v.text->rct;
tr.top--; tr.bottom--;
XI_RCT rct; coord2rct(win, left, top, width, height, rct);
rct.top += XI_FU_MULTIPLE - 2;
rct.bottom -= Y_FU_MULTIPLE / 2;
@ -881,6 +881,8 @@ void TField_control::create(WINDOW win, short cid,
frm_def->app_data = (long)this;
XI_RCT rct; coord2rct(win, left, top, width, height, rct);
rct.right += XI_FU_MULTIPLE/4;
unsigned long attrib = flags2attr(flags) | XI_ATR_AUTOSELECT;
if (!CAMPI_SCAVATI)
attrib |= XI_ATR_BORDER;
@ -889,7 +891,7 @@ void TField_control::create(WINDOW win, short cid,
XI_OBJ_DEF* def = xi_add_field_def(frm_def, cid,
rct.top, rct.left,
width * XI_FU_MULTIPLE + XI_FU_MULTIPLE/4,
rct.right - rct.left,
attrib, cid, maxlen+1,
NORMAL_COLOR, NORMAL_BACK_COLOR,
NORMAL_COLOR, DISABLED_BACK_COLOR,
@ -905,7 +907,7 @@ void TField_control::create(WINDOW win, short cid,
f->button = TRUE;
f->pixel_button_distance = 1;
}
if (rct.bottom - rct.top > Y_FU_MULTIPLE)
if (height > 1) // E' un multiline, quindi setto il rettangolo
f->xi_rct = rct;
XI_OBJ* itf = get_interface(win);
@ -1009,16 +1011,7 @@ void TButton_control::create(WINDOW win, short cid,
if (width <= 0) width = strlen(t)+3;
RCT rct; coord2rct(win, left, top, width, height, rct);
if (cid == DLG_F9)
{
rct.left++;
rct.top--;
rct.right++;
}
if (wc == WC_CHECKBOX)
rct.right += XI_FU_MULTIPLE / 2;
const unsigned long attrib = flags2attr(flags);
XI_OBJ_DEF* def = xi_add_button_def(NULL, cid, &rct, attrib, (char*)t, cid);
CHECKD(def, "Can't create the interface of TButton_control ", cid);
@ -1037,6 +1030,15 @@ void TButton_control::create(WINDOW win, short cid,
_obj = xi_create(container, def);
CHECKD(_obj, "Can't create TButton_control ", cid);
// Aggiusta bottoni con icona a sinistra
if (wc == WC_CHECKBOX || wc == WC_RADIOBUTTON)
{
RCT& r = _obj->v.btn->rct;
r.top++; r.bottom++;
r.right += XI_FU_MULTIPLE / 2;
}
xi_dequeue();
xi_tree_free(def);

View File

@ -243,20 +243,37 @@ HIDDEN BOOLEAN hook(HWND hwnd,
bool ok = FALSE;
const char* an = CUR_DDE->get_app_name();
if (an && *an)
ok = a.empty() || a == an;
if (ok)
{
ok = CUR_DDE->do_initiate(wparam, t);
if (ok)
{
TToken_string topics(t);
if (topics.empty_items())
topics = CUR_DDE->get_topics();
for (t = topics.get(0); t.not_empty(); t = topics.get())
{ // E' obbligatorio crearne dei nuovi! Non spostare fuori dal ciclo!
app = GlobalAddAtom(CUR_DDE->get_app_name());
topic = GlobalAddAtom(t);
SendMessage((HWND)wparam, WM_DDE_ACK, (WPARAM)hwnd, MAKELPARAM(app,topic));
ok = a.empty() || a.compare(an, -1, TRUE) == 0;
if (ok) // Server name ok
{
const bool query_topics = t.empty() || t == "*";
TToken_string topics = CUR_DDE->get_topics();
ok = !topics.empty_items(); // No topics?
if (ok && !query_topics)
{
ok = FALSE;
for (const char* topo = topics.get(0); topo; topo = topics.get())
{
if (t.compare(topo, -1, TRUE) == 0)
{
ok = TRUE;
break;
}
}
}
if (ok) // Topic ok
{
ok = CUR_DDE->do_initiate(wparam, t);
if (ok) // Connection ok
{
if (!query_topics)
topics = t;
for (t = topics.get(0); t.not_empty(); t = topics.get())
{ // E' obbligatorio crearne dei nuovi! Non spostare fuori dal ciclo!
app = GlobalAddAtom(CUR_DDE->get_app_name());
topic = GlobalAddAtom(t);
SendMessage((HWND)wparam, WM_DDE_ACK, (WPARAM)hwnd, MAKELPARAM(app,topic));
}
}
}
}
@ -273,10 +290,7 @@ HIDDEN BOOLEAN hook(HWND hwnd,
break;
case WM_DDE_EXECUTE:
{
TString cmd(256);
cmd = (const char*)GlobalLock((HGLOBAL)lparam);
GlobalUnlock((HGLOBAL)lparam);
const TString cmd((const char*)lparam);
DDEACK ack; memset(&ack, 0, sizeof(ack));
ack.fAck = CUR_DDE->do_execute(wparam, cmd);
// Ritorna indietro l'handle globale che verra' distrutto dal chiamante

View File

@ -96,7 +96,7 @@ TMessage* TMailbox::next(
// @mfunc Ritorna il prossimo messaggio con lo stesso oggetto
TMessage* TMailbox::next_s(
char* s, // @parm Oggetto del messaggio da ritornare
const char* s, // @parm Oggetto del messaggio da ritornare
bool read) // @parm Indica se il messaggio deve essere tra quelli
// letti (default FALSE)

View File

@ -134,7 +134,7 @@ public:
// @cmember Ritorna il prossimo messaggio
TMessage* next(bool read = FALSE);
// @cmember Ritorna il prossimo messaggio con lo stesso oggetto
TMessage* next_s(char* s, bool read = FALSE);
TMessage* next_s(const char* s, bool read = FALSE);
// @cmember Ritorna il prossimo messaggio con lo stesso mandante
TMessage* next_f(char* f, bool read = FALSE);
// @cmember Manda un messaggio

View File

@ -728,17 +728,17 @@ WINDOW TMask::read_page(
if (!orecchie && !toolbar) // Controlla se la maschera ha piu' di una pagina
{
const streampos pos = scanner.tellg(); // Memorizza posizione dello scanner
TString l(scanner.line().left(2));
while (l != "EN" && l.not_empty())
TString l(scanner.line());
while (l != "ENDMASK" && l.not_empty())
{
if (l == "PA") // Ho trovato un'altra pagina!
{
orecchie = TRUE; // Quindi devo metterci le orecchie
break;
}
l = scanner.line().left(2);
l = scanner.line();
}
scanner.seekg(pos); // Ripristin aposizione dello scanner
scanner.seekg(pos); // Ripristina posizione dello scanner
}
WINDOW w;