Modifiche per controllo Browsefile
git-svn-id: svn://10.65.10.50/trunk@677 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
e4b6713417
commit
2b82c13c08
@ -828,7 +828,7 @@ void TViswin::update ()
|
||||
if (_isopen)
|
||||
paint_waitbar (FALSE);
|
||||
#if XVT_OS == XVT_OS_WIN
|
||||
else
|
||||
else if (parent() == TASK_WIN)
|
||||
cpb_win_picture_draw_at (win(), _modpic, 4,
|
||||
4 + (int) (rows () - 3l) * CHARY);
|
||||
#endif
|
||||
@ -1809,7 +1809,9 @@ TViswin ::TViswin (const char *fname,
|
||||
const char *title,
|
||||
bool editbutton,
|
||||
bool printbutton,
|
||||
bool linkbutton):
|
||||
bool linkbutton,
|
||||
int height,
|
||||
WINDOW parent):
|
||||
_filename (fname), _txt (fname, BUFFERSIZE), _islink (linkbutton), _isedit (editbutton),
|
||||
_isprint (printbutton), _isbar (FALSE), _istimer (FALSE), _iscross (FALSE),
|
||||
_isselection (FALSE), _sel_displayed (FALSE), _cross_displayed (FALSE),
|
||||
@ -1827,14 +1829,19 @@ TViswin ::TViswin (const char *fname,
|
||||
|
||||
for (int i = 0; i < MAXBUT; i++)
|
||||
_button[i] = NULL_WIN;
|
||||
|
||||
if (parent == NULL_WIN)
|
||||
parent = TASK_WIN;
|
||||
|
||||
bool toplevel = parent == TASK_WIN;
|
||||
|
||||
const int larg = 76;
|
||||
const int alt = 20;
|
||||
RCT r;
|
||||
get_client_rect (TASK_WIN, &r);
|
||||
get_client_rect (parent, &r);
|
||||
int maxlarg = r.right / CHARX - 6; // Calculates max window width
|
||||
|
||||
int maxalt = r.bottom / CHARY - 6;
|
||||
int maxalt = height == 0 ? (r.bottom / CHARY - 6) : height;
|
||||
if (larg > maxlarg)
|
||||
maxlarg = larg;
|
||||
if (alt > maxalt)
|
||||
@ -1845,37 +1852,50 @@ TViswin ::TViswin (const char *fname,
|
||||
_picture[i] = cpb_picture_load (BMP_MODULE1 + i);
|
||||
_modpic = cpb_picture_load (BMP_MODULE);
|
||||
#endif
|
||||
|
||||
create (-1, -1, maxlarg, maxalt, title,
|
||||
WSF_CLOSE | WSF_HSCROLL | WSF_VSCROLL | WSF_SIZE);
|
||||
|
||||
long flags = WSF_HSCROLL | WSF_VSCROLL;
|
||||
if (toplevel)
|
||||
{
|
||||
flags |= (WSF_CLOSE | WSF_SIZE);
|
||||
}
|
||||
|
||||
WIN_TYPE rt = toplevel ? W_DOC : W_PLAIN;
|
||||
|
||||
|
||||
create (-1, parent == TASK_WIN ? -1 : 0, maxlarg, maxalt, title, flags, rt, parent);
|
||||
|
||||
set_opaque_text (TRUE);
|
||||
set_font (FF_FIXED);
|
||||
|
||||
add_button (DLG_QUIT, DLG_QUIT_TITLE);
|
||||
_buttons = 1;
|
||||
|
||||
if (_isedit)
|
||||
if (toplevel)
|
||||
{
|
||||
add_button (DLG_EDIT, DLG_EDIT_TITLE);
|
||||
_buttons++;
|
||||
}
|
||||
if (_islink)
|
||||
{
|
||||
_link_button = add_button (DLG_LINK, DLG_LINK_TITLE);
|
||||
_buttons++;
|
||||
xvt_enable_control (_link_button, FALSE);
|
||||
}
|
||||
if (_isprint)
|
||||
{
|
||||
add_button (DLG_PRINT, DLG_PRINT_TITLE);
|
||||
_buttons++;
|
||||
}
|
||||
|
||||
//#if XVT_OS == XVT_OS_SCOUNIX
|
||||
// maximize();
|
||||
// #endif
|
||||
add_button (DLG_QUIT, DLG_QUIT_TITLE);
|
||||
_buttons = 1;
|
||||
|
||||
|
||||
if (_isedit)
|
||||
{
|
||||
add_button (DLG_EDIT, DLG_EDIT_TITLE);
|
||||
_buttons++;
|
||||
}
|
||||
if (_islink)
|
||||
{
|
||||
_link_button = add_button (DLG_LINK, DLG_LINK_TITLE);
|
||||
_buttons++;
|
||||
xvt_enable_control (_link_button, FALSE);
|
||||
}
|
||||
if (_isprint)
|
||||
{
|
||||
add_button (DLG_PRINT, DLG_PRINT_TITLE);
|
||||
_buttons++;
|
||||
}
|
||||
|
||||
//#if XVT_OS == XVT_OS_SCOUNIX
|
||||
// maximize();
|
||||
// #endif
|
||||
}
|
||||
else _buttons = 0;
|
||||
|
||||
_curbut = 0;
|
||||
|
||||
if (_isopen)
|
||||
|
@ -136,7 +136,9 @@ public:
|
||||
const char* title = NULL,
|
||||
bool editbutton = TRUE,
|
||||
bool printbutton = TRUE,
|
||||
bool linkbutton = TRUE);
|
||||
bool linkbutton = TRUE,
|
||||
int height = 0,
|
||||
WINDOW parent = NULL_WIN);
|
||||
|
||||
virtual ~TViswin ();
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user