Patch level : 10.0
Files correlati : ba0.exe Ricompilazione Demo : [ ] Commento : Modernizzata maschera di cambio studio git-svn-id: svn://10.65.10.50/trunk@19744 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
90f8bd92ac
commit
b2813bcc28
119
ba/ba0100.cpp
119
ba/ba0100.cpp
@ -9,6 +9,7 @@
|
|||||||
#include <relation.h>
|
#include <relation.h>
|
||||||
#include <progind.h>
|
#include <progind.h>
|
||||||
#include <sheet.h>
|
#include <sheet.h>
|
||||||
|
#include <toolfld.h>
|
||||||
#include <treectrl.h>
|
#include <treectrl.h>
|
||||||
#include <utility.h>
|
#include <utility.h>
|
||||||
#include <urldefid.h>
|
#include <urldefid.h>
|
||||||
@ -1630,51 +1631,88 @@ HIDDEN int dir_sort(const TObject** d1, const TObject** d2)
|
|||||||
return xvt_str_compare_ignoring_case(s1, s2);
|
return xvt_str_compare_ignoring_case(s1, s2);
|
||||||
}
|
}
|
||||||
|
|
||||||
HIDDEN bool study_handler(TMask_field& f, KEY k)
|
class TStudy_mask : public TAutomask
|
||||||
{
|
{
|
||||||
bool ok = true;
|
protected:
|
||||||
if (f.to_check(k))
|
virtual bool on_field_event(TOperable_field& o, TField_event e, long jolly);
|
||||||
|
public:
|
||||||
|
TStudy_mask();
|
||||||
|
};
|
||||||
|
|
||||||
|
bool TStudy_mask::on_field_event(TOperable_field& o, TField_event e, long jolly)
|
||||||
|
{
|
||||||
|
switch (o.dlg())
|
||||||
{
|
{
|
||||||
TFilename path(f.get());
|
case DLG_FINDREC:
|
||||||
path.add("com");
|
if (e == fe_button)
|
||||||
path.add("dir.gen");
|
send_key(K_F9, DLG_USER, &o);
|
||||||
if (!path.exist() || path.find(' ') >= 0)
|
break;
|
||||||
ok = f.error_box("%s %s", (const char*)f.get(), TR("non e' uno studio valido!"));
|
case DLG_USER:
|
||||||
} else
|
if (e == fe_modify || e == fe_close)
|
||||||
if (k == K_F9)
|
|
||||||
{
|
|
||||||
TFilename str = firm2dir(-1);
|
|
||||||
for (int i = str.len()-2; i > 0; i--)
|
|
||||||
{
|
{
|
||||||
if (str[i] == '\\' || str[i] == '/')
|
TFilename path(o.get());
|
||||||
{
|
path.add("com");
|
||||||
str.cut(i);
|
path.add("dir.gen");
|
||||||
break;
|
if (!path.exist() || path.find(' ') >= 0)
|
||||||
}
|
return error_box("%s %s", (const char*)o.get(), TR("non e' uno studio valido!"));
|
||||||
}
|
}
|
||||||
str.add("*");
|
if (e == fe_button)
|
||||||
SLIST dirs = xvt_fsys_list_files(DIR_TYPE, str.get_buffer(), true);
|
{
|
||||||
|
TFilename str = firm2dir(-1);
|
||||||
TFilename dirgen;
|
for (int i = str.len()-2; i > 0; i--)
|
||||||
TArray_sheet sht(-1, -1, 78, 16, TR("Scelta studio"), HR("Studio@76"));
|
|
||||||
for (SLIST_ELT e = xvt_slist_get_first(dirs); e; e = xvt_slist_get_next(dirs, e))
|
|
||||||
{
|
|
||||||
const char* f = xvt_slist_get(dirs, e, NULL);
|
|
||||||
dirgen = f;
|
|
||||||
if (dirgen.find(' ') < 0)
|
|
||||||
{
|
{
|
||||||
dirgen.add("com/dir.gen");
|
if (str[i] == '\\' || str[i] == '/')
|
||||||
if (dirgen.exist())
|
{
|
||||||
sht.add(f);
|
str.cut(i);
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
str.add("*");
|
||||||
xvt_slist_destroy(dirs);
|
SLIST dirs = xvt_fsys_list_files(DIR_TYPE, str, true);
|
||||||
|
|
||||||
sht.rows_array().TArray::sort(dir_sort);
|
TFilename dirgen;
|
||||||
if (sht.run() == K_ENTER)
|
TArray_sheet sht(-1, -1, 78, 20, TR("Scelta studio"), HR("Studio@72|Ditte"));
|
||||||
f.set(sht.row(-1)); // -1 = selected row
|
for (SLIST_ELT e = xvt_slist_get_first(dirs); e; e = xvt_slist_get_next(dirs, e))
|
||||||
|
{
|
||||||
|
const char* f = xvt_slist_get(dirs, e, NULL);
|
||||||
|
dirgen = f;
|
||||||
|
if (dirgen.find(' ') < 0) // Scarta gli studi contenenti spazi
|
||||||
|
{
|
||||||
|
dirgen.add("com/dir.gen");
|
||||||
|
if (dirgen.exist())
|
||||||
|
{
|
||||||
|
TToken_string row = f;
|
||||||
|
str = f; str.add("?????A");
|
||||||
|
SLIST firms = xvt_fsys_list_files(DIR_TYPE, str, true);
|
||||||
|
row.add(xvt_slist_count(firms));
|
||||||
|
xvt_slist_destroy(firms);
|
||||||
|
sht.add(row);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
xvt_slist_destroy(dirs);
|
||||||
|
|
||||||
|
sht.rows_array().TArray::sort(dir_sort);
|
||||||
|
if (sht.run() == K_ENTER)
|
||||||
|
o.set(sht.row(-1)); // -1 = selected row
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
return ok;
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
TStudy_mask::TStudy_mask() : TAutomask(TR("Scelta studio"), 1, 60, 3)
|
||||||
|
{
|
||||||
|
add_button_tool(DLG_OK, "", TOOL_OK);
|
||||||
|
add_button_tool(DLG_FINDREC, TR("Ricerca"), TOOL_FINDREC);
|
||||||
|
add_button_tool(DLG_NULL, "", 0);
|
||||||
|
add_button_tool(DLG_HELP, TR("Help"), TOOL_HELP);
|
||||||
|
add_button_tool(DLG_NULL, "", 0);
|
||||||
|
add_button_tool(DLG_CANCEL, "", TOOL_CANCEL);
|
||||||
|
add_string(DLG_USER, 0, "", 1, 1, 260, "B", 56);
|
||||||
|
set_handlers();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TMenu_application::choose_study()
|
bool TMenu_application::choose_study()
|
||||||
@ -1682,12 +1720,7 @@ bool TMenu_application::choose_study()
|
|||||||
// Disbilita le voci di personalizzazione
|
// Disbilita le voci di personalizzazione
|
||||||
enable_options_menu(false);
|
enable_options_menu(false);
|
||||||
|
|
||||||
TMask m(TR("Scelta studio"), 1, 62, 4);
|
TStudy_mask m;
|
||||||
m.add_button(DLG_OK, 0, "", -12, -1, 10, 2);
|
|
||||||
m.add_button(DLG_CANCEL, 0, "", -22, -1, 10, 2);
|
|
||||||
m.add_string(DLG_USER, 0, PR("Studio "), 1, 1, 50, "B");
|
|
||||||
m.set_handler(DLG_USER, study_handler);
|
|
||||||
m.set(DLG_USER, prefix().get_studio());
|
|
||||||
bool ok = m.run() == K_ENTER;
|
bool ok = m.run() == K_ENTER;
|
||||||
if (ok)
|
if (ok)
|
||||||
{
|
{
|
||||||
|
@ -10,6 +10,7 @@
|
|||||||
#include <prefix.h>
|
#include <prefix.h>
|
||||||
#include <utility.h>
|
#include <utility.h>
|
||||||
#include <xvtility.h>
|
#include <xvtility.h>
|
||||||
|
#include <colors.h>
|
||||||
|
|
||||||
enum { DLG_TREE = 101, DLG_LOOK = 102, DLG_MAIN = 103 };
|
enum { DLG_TREE = 101, DLG_LOOK = 102, DLG_MAIN = 103 };
|
||||||
|
|
||||||
@ -293,8 +294,48 @@ void TBook_window::erode_antipa()
|
|||||||
void TBook_window::set_logo(const char* logo)
|
void TBook_window::set_logo(const char* logo)
|
||||||
{
|
{
|
||||||
_logo.load(logo);
|
_logo.load(logo);
|
||||||
if (_logo.ok() && can_be_transparent(_logo))
|
if (is_power_station())
|
||||||
_logo.convert_transparent_color(NORMAL_BACK_COLOR);
|
{
|
||||||
|
const short w = _logo.width();
|
||||||
|
const short h = _logo.height();
|
||||||
|
const short h2 = h/4;
|
||||||
|
|
||||||
|
XVT_IMAGE big = xvt_image_create(XVT_IMAGE_RGB, w, h+h2, 0);
|
||||||
|
for (short y = 0; y < h; y++)
|
||||||
|
{
|
||||||
|
for (short x = 0; x < w; x++)
|
||||||
|
{
|
||||||
|
const COLOR rgb = _logo.get_pixel(x, y);
|
||||||
|
xvt_image_set_pixel(big, x, y, rgb);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for (short y = 0; y < h2; y++)
|
||||||
|
{
|
||||||
|
const double weight = 0.5+double(y)/double(2*h2);
|
||||||
|
const short sy = h-y*h/h2-1;
|
||||||
|
for (short x = 0; x < w; x++)
|
||||||
|
{
|
||||||
|
const short sx = x-2*y;
|
||||||
|
COLOR col = MASK_LIGHT_COLOR;
|
||||||
|
if (sx >= 0)
|
||||||
|
{
|
||||||
|
COLOR rgb = xvt_image_get_pixel(big, sx, sy);
|
||||||
|
const int r = XVT_COLOR_GET_RED(rgb);
|
||||||
|
const int g = XVT_COLOR_GET_GREEN(rgb);
|
||||||
|
const int b = XVT_COLOR_GET_BLUE(rgb);
|
||||||
|
if (r != g || g != b)
|
||||||
|
col = blend_colors(col, rgb, weight);
|
||||||
|
}
|
||||||
|
xvt_image_set_pixel(big, x, y+h, col);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
_logo.set(big);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (_logo.ok() && can_be_transparent(_logo))
|
||||||
|
_logo.convert_transparent_color(NORMAL_BACK_COLOR);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
TBook_window::TBook_window(int x, int y, int dx, int dy,
|
TBook_window::TBook_window(int x, int y, int dx, int dy,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user