Patch level : 10.0

Files correlati     : cg2.exe cg2100a.msk cg2100k.msk
Ricompilazione Demo : [ ]
Commento            :
Rimodernata maschera di selezione colori di prima nota


git-svn-id: svn://10.65.10.50/trunk@18382 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
guy 2009-02-27 14:18:02 +00:00
parent 2b37fd2d2f
commit a756ea9067
6 changed files with 42 additions and 34 deletions

View File

@ -62,6 +62,7 @@ TMask* TPrimanota_application::load_mask(int n)
m->set_handler(F_NUMREG, num_handler);
m->set_handler(F_CODCAUS, caus_query_handler);
m->set_handler(F_DATAREG, datareg_handler);
m->set_handler(DLG_CONFIG, colors_handler);
TConfig c(CONFIG_STUDIO, "cg");
@ -390,17 +391,6 @@ void TPrimanota_application::print()
stampa.run();
}
bool TPrimanota_application::menu(MENU_TAG mt)
{
bool ok = true;
if (mt == MENU_ITEM_ID(1))
set_colors();
else
ok = TRelation_application::menu(mt);
return ok;
}
bool TPrimanota_application::changing_mask(int mode)
{
if (mode == MODE_QUERY)

View File

@ -2,7 +2,20 @@
TOOLBAR "topbar" 0 0 0 2
#include <relapbar.h>
#include <filebar.h>
BUTTON DLG_NULL 2 2
BEGIN
PROMPT 1 1 ""
END
BUTTON DLG_CONFIG 2 2
BEGIN
PROMPT 2 1 "Opzioni"
PICTURE TOOL_CONFIG
END
#include <cancelbar.h>
ENDPAGE

View File

@ -2,9 +2,7 @@
#include "cg21sld.h"
TOOLBAR "topbar" 0 0 0 2
#include <relapbar.h>
ENDPAGE
PAGE "Testata" -1 -1 77 20

View File

@ -1,4 +1,4 @@
PAGE "Colori delle righe di prima nota" -1 -1 42 10
PAGE "Colori delle righe di prima nota" -1 -1 42 15
SPREADSHEET 101 -1 -3
BEGIN
@ -7,9 +7,19 @@ BEGIN
FLAGS "D"
END
ENDPAGE
TOOLBAR "topbar" 0 0 0 2
BUTTON DLG_OK 10 2
BEGIN
PROMPT -33 -1 ""
END
BUTTON 102 10 2
BEGIN
PROMPT -13 -1 "A~zzera"
PICTURE TOOL_DELREC
END
BUTTON DLG_CANCEL 10 2
@ -17,11 +27,6 @@ BEGIN
PROMPT -23 -1 ""
END
BUTTON DLG_OK 10 2
BEGIN
PROMPT -33 -1 ""
END
ENDPAGE
ENDMASK

View File

@ -150,6 +150,7 @@ class TPrimanota_application : public TRelation_application
static bool pag_notify(TSheet_field& s, int r, KEY key);
static bool pag_sheet_handler(TMask_field& f, KEY key);
static bool colors_handler(TMask_field& f, KEY k);
static bool quadratura_handler(TMask_field& f, KEY k); // Bottone quadratura per ATS
@ -162,12 +163,10 @@ protected: // TApplication
virtual void on_firm_change();
virtual void on_config_change();
virtual void print();
virtual bool menu(MENU_TAG m);
virtual void ini2mask(TConfig& ini, TMask& msk, bool query);
virtual void mask2ini(const TMask& msk, TConfig& ini);
virtual bool save(bool check_dirty);
bool get_mask_swap_file(TFilename& name) const;
bool force_mask_swap(const TCausale& old_caus, const TCausale& new_caus);

View File

@ -45,8 +45,7 @@ TRow_mask* TColor_mask::_sheet_mask = NULL;
TRow_mask::TRow_mask()
: TMask("cg2100k", 1)
{
}
{ }
void TRow_mask::update()
{
@ -123,9 +122,9 @@ bool TColor_mask::reset_handler(TMask_field& f, KEY k)
{
if (k == K_SPACE && f.yesno_box(TR("Si desidera azzerare tutti i colori?")))
{
app().reset_colors();
TSheet_field& s = f.mask().sfield(101);
s.set_back_and_fore_color(NORMAL_BACK_COLOR, NORMAL_COLOR, -1);
app().reset_colors();
TSheet_field& s = (TSheet_field&)f.mask().fld(0);
s.set_back_and_fore_color(COLOR_INVALID, COLOR_INVALID, -1);
s.force_update();
}
return TRUE;
@ -165,11 +164,10 @@ TColor_mask::TColor_mask()
TPrimanota_application& a = app();
int row = 0;
int d = 0;
int row = 0, d = 0;
COLOR back, fore;
for (const char* c = tipi; *c; c++, d++)
{
COLOR back, fore;
a.type2colors(*c, back, fore);
TToken_string& riga = s.row(-1);
riga << TR("Riga ") << *c << " - " << desc[d];
@ -286,15 +284,20 @@ void TPrimanota_application::reset_colors()
void TPrimanota_application::set_colors()
{
disable_menu_item(M_FONT);
TColor_mask colors;
if (colors.run() == K_ENTER)
app().save_colors();
save_colors();
else
app().load_colors();
enable_menu_item(M_FONT);
load_colors();
}
bool TPrimanota_application::colors_handler(TMask_field& f, KEY k)
{
if (k == K_SPACE)
app().set_colors();
return true;
}
///////////////////////////////////////////////////////////
// Gestione cambiamento prorata
///////////////////////////////////////////////////////////