Modifiche per controllo Browsefile

git-svn-id: svn://10.65.10.50/trunk@677 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
villa 1994-11-22 08:55:29 +00:00
parent e4b6713417
commit 2b82c13c08
2 changed files with 52 additions and 30 deletions

View File

@ -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),
@ -1828,13 +1830,18 @@ 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)
@ -1846,15 +1853,26 @@ TViswin ::TViswin (const char *fname,
_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);
if (toplevel)
{
add_button (DLG_QUIT, DLG_QUIT_TITLE);
_buttons = 1;
if (_isedit)
{
add_button (DLG_EDIT, DLG_EDIT_TITLE);
@ -1875,6 +1893,8 @@ TViswin ::TViswin (const char *fname,
//#if XVT_OS == XVT_OS_SCOUNIX
// maximize();
// #endif
}
else _buttons = 0;
_curbut = 0;

View File

@ -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 ();
};