Aggiunte diverse immagini al menu principale
git-svn-id: svn://10.65.10.50/trunk@269 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
d63359fe87
commit
a31f2fb728
99
ba/ba0.cpp
99
ba/ba0.cpp
@ -1,13 +1,12 @@
|
||||
#include <applicat.h>
|
||||
#include <execp.h>
|
||||
#include <mask.h>
|
||||
#include <scanner.h>
|
||||
#include <strings.h>
|
||||
#include <utility.h>
|
||||
#include <urldefid.h>
|
||||
|
||||
#if XVT_OS == XVT_OS_WIN
|
||||
extern "C" {
|
||||
extern "C"
|
||||
{
|
||||
#include <cpb.h>
|
||||
}
|
||||
#endif
|
||||
@ -20,32 +19,52 @@ extern "C" {
|
||||
|
||||
class TPicture_mask : public TMask
|
||||
{
|
||||
PICTURE _picture;
|
||||
static short _id;
|
||||
static PICTURE _picture;
|
||||
|
||||
protected:
|
||||
virtual void handler(WINDOW win, EVENT* ep);
|
||||
void set_picture(short id);
|
||||
|
||||
public:
|
||||
TPicture_mask(const char* name, int dx, int dy, short picture_id);
|
||||
~TPicture_mask();
|
||||
void reset();
|
||||
};
|
||||
|
||||
TPicture_mask::TPicture_mask(const char* name, int dx, int dy,
|
||||
short picture_id)
|
||||
: TMask(name, 1, dx, dy), _picture(0L)
|
||||
short TPicture_mask::_id = 0;
|
||||
PICTURE TPicture_mask::_picture = 0L;
|
||||
|
||||
void TPicture_mask::set_picture(short id)
|
||||
{
|
||||
if (id != _id)
|
||||
{
|
||||
_id = id;
|
||||
#if XVT_OS == XVT_OS_WIN
|
||||
_picture = cpb_picture_load(picture_id);
|
||||
if (_picture) picture_free(_picture);
|
||||
_picture = cpb_picture_load(id);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
TPicture_mask::~TPicture_mask()
|
||||
void TPicture_mask::reset()
|
||||
{
|
||||
#if XVT_OS == XVT_OS_WIN
|
||||
if (_picture)
|
||||
{
|
||||
picture_free(_picture);
|
||||
_picture = 0L;
|
||||
_id = 0;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
TPicture_mask::TPicture_mask(const char* name, int dx, int dy, short pic)
|
||||
: TMask(name, 1, dx, dy)
|
||||
{
|
||||
set_picture(pic);
|
||||
}
|
||||
|
||||
|
||||
|
||||
void TPicture_mask::handler(WINDOW win, EVENT* ep)
|
||||
{
|
||||
@ -55,7 +74,7 @@ void TPicture_mask::handler(WINDOW win, EVENT* ep)
|
||||
{
|
||||
#if XVT_OS == XVT_OS_WIN
|
||||
if (_picture)
|
||||
cpb_win_picture_draw_at(win, _picture, 1, 1);
|
||||
cpb_win_picture_draw_at(win, _picture, 1, 64);
|
||||
else
|
||||
#endif
|
||||
{
|
||||
@ -142,40 +161,51 @@ int TMenu_application::do_level()
|
||||
{
|
||||
const int first = _first[_level];
|
||||
const int last = _first[_level+1];
|
||||
const char* head = ((TToken_string&)_menu[first]).get(1);
|
||||
TToken_string& row = (TToken_string&)_menu[first];
|
||||
const TString80 head(row.get(1));
|
||||
|
||||
const int width = 72;
|
||||
const int heigth = 18;
|
||||
const int bwidth = 20;
|
||||
const int x = width-bwidth-12;
|
||||
|
||||
TPicture_mask menu(head, width, heigth, BA0_PICTURE);
|
||||
const short pic = BA0_PICTURE+(short)row.get_int();
|
||||
TPicture_mask menu(head, width, heigth, pic);
|
||||
|
||||
int y = 1;
|
||||
|
||||
#if XVT_OS == XVT_OS_WIN
|
||||
TString t(format("#%d", BMP_STOPREC));
|
||||
TString16 t(format("#%d", BMP_STOPREC));
|
||||
#else
|
||||
TString t;
|
||||
TString16 t;
|
||||
#endif
|
||||
|
||||
TString item(32);
|
||||
for (int i = first+1; i < last; i++, y++)
|
||||
{
|
||||
TToken_string& row = (TToken_string&)_menu[i];
|
||||
item = row.get(1);
|
||||
TString80 item(row.get(1));
|
||||
if (isdigit(*row.get())) item << "...";
|
||||
menu.add_static(-1, 0, item, x+4, y);
|
||||
menu.add_button(100+y, 0, t, x, y, 1, 1);
|
||||
menu.set_handler(100+y, menu_item_handler);
|
||||
menu.add_static(-1, 0, item, x+4, y);
|
||||
}
|
||||
|
||||
t = first ? "Menu precedente" : "Fine";
|
||||
const short id = first ? DLG_CANCEL : DLG_QUIT;
|
||||
menu.add_button(id, 0, t, x, heigth-2, bwidth, 2);
|
||||
menu.add_button(first ? DLG_CANCEL : DLG_QUIT, 0, t, -22, -2, bwidth, 2);
|
||||
if (first)
|
||||
menu.add_button(DLG_QUIT, 0, "Fine", -12, -2, bwidth, 2);
|
||||
|
||||
menu.run();
|
||||
int k = menu.last_key();
|
||||
int m =(k == K_QUIT || k == K_ESC) ? -1 : first+last_button-100;
|
||||
const int k = menu.run();
|
||||
int m = 0;
|
||||
switch (k)
|
||||
{
|
||||
case K_ESC:
|
||||
m = -1; break;
|
||||
case K_QUIT:
|
||||
menu.reset();
|
||||
m = -2; break;
|
||||
default:
|
||||
m = first+last_button-100; break;
|
||||
}
|
||||
return m;
|
||||
}
|
||||
|
||||
@ -196,18 +226,19 @@ bool TMenu_application::menu(MENU_TAG)
|
||||
_level = 0;
|
||||
while (i >= 0)
|
||||
{
|
||||
int m = do_level();
|
||||
const int m = do_level();
|
||||
if (m >= 0)
|
||||
{
|
||||
const char* option = ((TToken_string&)_menu[m]).get(2);
|
||||
TToken_string& row = (TToken_string&)_menu[m];
|
||||
const char* option = row.get(2);
|
||||
if (option && *option)
|
||||
{
|
||||
int l = atoi(option);
|
||||
const int l = atoi(option);
|
||||
if (l > 0)
|
||||
{
|
||||
const char* flags = ((TToken_string&)_menu[m]).get(3);
|
||||
|
||||
if (flags && strchr(flags, 'F') != NULL) set_firm();
|
||||
const char* flags = row.get();
|
||||
if (flags && strchr(flags, 'F') != NULL)
|
||||
set_firm();
|
||||
refarray[i++] = _level;
|
||||
if (l < _max) _level = l;
|
||||
}
|
||||
@ -218,7 +249,11 @@ bool TMenu_application::menu(MENU_TAG)
|
||||
}
|
||||
}
|
||||
}
|
||||
else _level = (--i >= 0) ? refarray[i] : 0;
|
||||
else
|
||||
{
|
||||
if (m < -1) break;
|
||||
_level = (--i >= 0) ? refarray[i] : 0;
|
||||
}
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
@ -228,6 +263,6 @@ int main(int argc, char** argv)
|
||||
{
|
||||
const char* menu = (argc < 2) ? "prassi.mnu" : argv[1];
|
||||
TMenu_application ma(menu);
|
||||
ma.run(argc, argv, "Menu principale");
|
||||
ma.run(argc, argv, "Menu Principale");
|
||||
return TRUE;
|
||||
}
|
||||
|
@ -1,13 +1,14 @@
|
||||
#include <default.url>
|
||||
#include "ba0.h"
|
||||
|
||||
MENU TASK_MENUBAR
|
||||
SUBMENU MENU_FILE "~File"
|
||||
|
||||
|
||||
#if XVT_OS == XVT_OS_WIN
|
||||
#transparent $$$
|
||||
BA0_PICTURE bitmap DISCARDABLE f:\p.due\bmp\ba0.bmp
|
||||
883 bitmap DISCARDABLE f:\p.due\bmp\ba00.bmp
|
||||
884 bitmap DISCARDABLE f:\p.due\bmp\ba01.bmp
|
||||
885 bitmap DISCARDABLE f:\p.due\bmp\ba02.bmp
|
||||
886 bitmap DISCARDABLE f:\p.due\bmp\ba03.bmp
|
||||
$$$
|
||||
#endif
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
#include "ba3300.h"
|
||||
|
||||
PAGE "" -1 -1 74 20
|
||||
PAGE "Stampa fogli libro bollato" -1 -1 74 20
|
||||
|
||||
NUMBER F_ANNO 4
|
||||
BEGIN
|
||||
|
@ -57,7 +57,7 @@ END
|
||||
|
||||
SPREADSHEET F_SHEET_LBU
|
||||
BEGIN
|
||||
PROMPT 2 5 ""
|
||||
PROMPT 0 5 ""
|
||||
ITEM "Anno reg."
|
||||
ITEM "Mese reg."
|
||||
ITEM "Num.ini.reg.un."
|
||||
|
@ -1,6 +1,6 @@
|
||||
#include "ba3600.h"
|
||||
|
||||
PAGE "" -1 -1 78 20
|
||||
PAGE "Stampa indici libro unico" -1 -1 78 20
|
||||
|
||||
RADIOBUTTON F_TIPO_STAMPA 25
|
||||
BEGIN
|
||||
@ -29,12 +29,12 @@ END
|
||||
|
||||
TEXT F_TITOLO_PROVA
|
||||
BEGIN
|
||||
PROMPT 33 7 "STAMPA DI PROVA"
|
||||
PROMPT -11 7 "STAMPA DI PROVA"
|
||||
END
|
||||
|
||||
TEXT F_TITOLO_BOLLATO
|
||||
BEGIN
|
||||
PROMPT 25 7 "STAMPA SU LIBRI BOLLATI DELLO STUDIO"
|
||||
PROMPT -11 7 "STAMPA SU LIBRI BOLLATI DELLO STUDIO"
|
||||
END
|
||||
|
||||
DATE F_DATA_STAMPA
|
||||
@ -143,14 +143,15 @@ BEGIN
|
||||
PROMPT 4 15 "Ultim.num.pagina stampata libro unico "
|
||||
END
|
||||
|
||||
BUTTON DLG_OK 9 0
|
||||
BUTTON DLG_PRINT 9 2
|
||||
BEGIN
|
||||
PROMPT 51 18 ""
|
||||
PROMPT -12 -1 "~Stampa"
|
||||
MESSAGE EXIT,K_ENTER
|
||||
END
|
||||
|
||||
BUTTON DLG_CANCEL 9 0
|
||||
BUTTON DLG_QUIT 9 2
|
||||
BEGIN
|
||||
PROMPT 63 18 ""
|
||||
PROMPT -22 -1 ""
|
||||
END
|
||||
|
||||
ENDPAGE
|
||||
|
@ -155,7 +155,7 @@ BEGIN
|
||||
USE %AIS
|
||||
INPUT CODTAB FLD_GD1_CODATTPREV
|
||||
DISPLAY "Codice" CODTAB
|
||||
DISPLAY "Attivita' " S0
|
||||
DISPLAY "Attivita'@50" S0
|
||||
OUTPUT FLD_GD1_CODATTPREV CODTAB
|
||||
OUTPUT FLD_GD1_CODATTPREV_TABATT_DESCR S0
|
||||
HELP "Inserire il codice dell'attivita' prevalente della ditta"
|
||||
@ -165,7 +165,7 @@ END
|
||||
|
||||
STRING FLD_GD1_CODATTPREV_TABATT_DESCR 50
|
||||
BEGIN
|
||||
PROMPT 1 10 "Nome "
|
||||
PROMPT 1 10 "Descrizione "
|
||||
FLAGS "D"
|
||||
HELP ""
|
||||
END
|
||||
|
@ -12,13 +12,17 @@ PAGE "Registri" -1 -1 78 18
|
||||
NUMBER F_CODDITTA 5
|
||||
BEGIN
|
||||
FLAGS "FRH"
|
||||
USE LF_NDITTE
|
||||
INPUT CODDITTA F_CODDITTA
|
||||
OUTPUT F_ATTIVITA CODATTPREV
|
||||
CHECKTYPE NORMAL
|
||||
END
|
||||
|
||||
NUMBER F_ANNO 4
|
||||
BEGIN
|
||||
PROMPT 4 1 "Anno "
|
||||
FIELD CODTAB[1,4]
|
||||
FLAGS "ZAP"
|
||||
FLAGS "AZ"
|
||||
KEY 1
|
||||
GROUP 1
|
||||
USE REG
|
||||
@ -41,12 +45,7 @@ BEGIN
|
||||
FLAGS "U"
|
||||
KEY 1
|
||||
GROUP 1
|
||||
COPY USE F_ANNO
|
||||
DISPLAY "Anno" CODTAB[1,4]
|
||||
DISPLAY "Codice" CODTAB[5,7]
|
||||
DISPLAY "Descrizione @50" S0
|
||||
DISPLAY "Tipo" I0
|
||||
COPY OUTPUT F_ANNO
|
||||
COPY ALL F_ANNO
|
||||
CHECKTYPE REQUIRED
|
||||
END
|
||||
|
||||
@ -126,9 +125,9 @@ BEGIN
|
||||
INPUT CODDITTA F_CODDITTA SELECT
|
||||
INPUT CODATT F_ATTIVITA
|
||||
DISPLAY "Codice" CODATT
|
||||
DISPLAY "Descrizione@40" DESCR
|
||||
DISPLAY "Descrizione@50" DESCR
|
||||
OUTPUT F_ATTIVITA CODATT
|
||||
HELP "Introdurre il codice dell' attivita'"
|
||||
HELP "Codice dell'attivita' della ditta"
|
||||
CHECKTYPE REQUIRED
|
||||
WARNING "Attivita' non prevista per questa ditta"
|
||||
END
|
||||
@ -193,9 +192,11 @@ BEGIN
|
||||
INPUT CODTAB[1,4] F_ANNO SELECT
|
||||
INPUT CODTAB[5,7] F_CODLBU
|
||||
DISPLAY "Anno" CODTAB[1,4]
|
||||
DISPLAY "Codice libro unico" CODTAB[5,7]
|
||||
DISPLAY "Codice" CODTAB[5,7]
|
||||
DISPLAY "Descrizione@50" S0
|
||||
OUTPUT F_ANNO CODTAB[1,4]
|
||||
OUTPUT F_CODLBU CODTAB[5,7]
|
||||
ADD RUN ba3 -4
|
||||
CHECKTYPE NORMAL
|
||||
WARNING "Libro unico assente"
|
||||
END
|
||||
|
@ -1,8 +1,8 @@
|
||||
0|Menu Principale |
|
||||
0|Menu Principale|
|
||||
0|Anagrafiche|1
|
||||
0|Contabilita'|4
|
||||
0|Manutenzione|ba1
|
||||
1|Gestione Anagrafiche |
|
||||
1|Gestione Anagrafiche|1
|
||||
1|Persone fisiche|ba4 -1 F
|
||||
1|Persone giuridiche|ba4 -1 G
|
||||
1|Ditte|ba4 -2
|
||||
@ -16,7 +16,7 @@
|
||||
1|Stampa tabelle|3
|
||||
1|Stampa tabelle ministeriali|12
|
||||
1|Stampa numerazione registri|ba3 -2
|
||||
2|Tabell|
|
||||
2|Tabelle|1
|
||||
2|Codici IVA|ba3 -0 %iva
|
||||
2|Codici Attivita'|ba3 -0 %ais
|
||||
2|Cond. di pagamento|ba3 -0 %cpg
|
||||
@ -28,7 +28,7 @@
|
||||
2|Stati esteri|ba3 -0 %sta
|
||||
2|Valute|ba3 -0 %val
|
||||
2|Lingue|ba3 -0 %lng
|
||||
3|Stampa tabelle|
|
||||
3|Stampa tabelle|3
|
||||
3|Codici IVA|ba3 -1 %iva
|
||||
3|Codici Attivita'|ba3 -1 %ais
|
||||
3|Cond. di pagamento|ba3 -1 %cpg
|
||||
@ -40,7 +40,7 @@
|
||||
3|Stati esteri|ba3 -1 %sta
|
||||
3|Valute|ba3 -1 %val
|
||||
3|Lingue|ba3 -1 %lng
|
||||
4|Contabilita' |
|
||||
4|Contabilita'|2
|
||||
4|Persone fisiche|ba4 -1 F
|
||||
4|Persone giuridiche|ba4 -1 G
|
||||
4|Ditte|ba4 -2
|
||||
@ -49,6 +49,7 @@
|
||||
4|Scelta contabilita'|13|F
|
||||
4|IVA|10
|
||||
4|Parametri di studio|cg5 -0
|
||||
4|Gestione Libro Unico|14
|
||||
5|Tabelle studio|
|
||||
5|Tipi documento|ba3 -0 %tpd
|
||||
5|Cond. di pagamento|ba3 -0 %cpg
|
||||
@ -80,14 +81,14 @@
|
||||
7|Clienti/Fornitori|cg0 -1
|
||||
7|Banche|ba3 -0 %ban
|
||||
7|Esercizi|ba3 -0 esc
|
||||
8|Stampa tabelle ditta|
|
||||
8|Stampa tabelle ditta|3
|
||||
8|Registri|ba3 -1 reg
|
||||
8|Piano dei conti|cg1 -0
|
||||
8|Causali|cg1 -6
|
||||
8|Clienti/Fornitori|cg1 -1
|
||||
8|Banche|ba3 -1 %ban
|
||||
9|Prima nota |
|
||||
9|Prima nota |cg2 -0
|
||||
9|Prima nota|2
|
||||
9|Prima nota|cg2 -0
|
||||
9|Ricalcolo saldi|cg4 -0
|
||||
9|IVA|10
|
||||
9|Lista movimenti|cg3 -0
|
||||
@ -96,7 +97,7 @@
|
||||
9|Bilancio|cg1 -4
|
||||
9|Bilancio IV direttiva CEE|cg1 -5
|
||||
9|Giornale|cg3 -3
|
||||
10|IVA|
|
||||
10|IVA|2
|
||||
10|Liquidazione|cg4 -2
|
||||
10|Deleghe|ba3 -0 %del
|
||||
10|Stampa deleghe|cg1 -3
|
||||
@ -122,4 +123,8 @@
|
||||
13|Tabelle ditta|7
|
||||
13|Stampa tabelle ditta|8
|
||||
13|Prima nota|9
|
||||
14|Gestione Libro Unico
|
||||
14|Tabella Libro Unico|ba3 -4
|
||||
14|Tabella Vidimazioni|ba3 -0 %vid
|
||||
14|Stampa Indici Libro Unico|ba3 -5
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user