Viswin se possibile ancora piu' extrafiga

Aggiunte ricerche, menu, etc. anche a text


git-svn-id: svn://10.65.10.50/trunk@818 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
villa 1995-01-03 16:44:27 +00:00
parent a1fb8b2989
commit 16f9494a42
7 changed files with 202 additions and 68 deletions

View File

@ -25,16 +25,32 @@ MENU MENU_FILE
ITEM (M_FILE+11) "I~nformazioni" ITEM (M_FILE+11) "I~nformazioni"
ITEM M_FILE_QUIT "~Fine" ITEM M_FILE_QUIT "~Fine"
MENU MENU_EDIT MENUBAR VISWIN_BAR
ITEM M_EDIT_INSERT "~Inserisci"
ITEM M_EDIT_MODIFY "~Aggiorna" MENU VISWIN_BAR
ITEM M_EDIT_DELETE "~Cancella" SUBMENU MENU_VISWIN "~Visualizzazione"
ITEM M_EDIT_SHOW "~Visualizza" SUBMENU M_EDIT "~Edit"
ITEM M_EDIT_SEARCH "C~erca" DISABLED
MENU MENU_VISWIN
ITEM M_EDIT_CLIPBOARD "Interrompi\tESC"
ITEM M_EDIT_CUT "Collega...\tAlt+C" DISABLED
ITEM M_EDIT_PASTE "Esporta...\tAlt+E"
ITEM M_EDIT_SEL_ALL "Stampa... \tAlt+S" DISABLED
SEPARATOR
ITEM M_FONT "Mostra righelli" CHECKABLE
ITEM M_STYLE "Mostra bottoni" CHECKABLE
SEPARATOR
ITEM M_EDIT_QUIT "Chiudi\tESC+ESC"
MENU M_EDIT
ITEM M_EDIT_COPY "~Copia" DISABLED
ITEM M_EDIT_CLEAR "~Annulla" DISABLED
SEPARATOR
ITEM M_EDIT_SEARCH "Cerca...\tF8"
ITEM M_EDIT_DELETE "Cerca il prossimo\tF9" DISABLED
SEPARATOR
ITEM M_EDIT_UNDO "~Ridisegna"
MENU MENU_ALT_EDIT
ITEM M_EDIT_EDIT "~Aggiorna"
ITEM M_EDIT_SEARCH "C~erca" DISABLED
ACCEL MENU_FILE "f" ALT ACCEL MENU_FILE "f" ALT

View File

@ -214,12 +214,18 @@ const char *TTextfile::line(long j, long pos, int howmuch)
} }
long TTextfile::search(const char* txt, int& ret, long from, bool down) long TTextfile::search(const char* txt, int& ret, long from, bool down,
bool casesens)
{ {
TString256 lin; TString256 lin; TString80 text(txt);
if (!casesens)
text.lower();
for (long i = from; down ? (i < lines()) : (i >= 0); down ? i++ : i--) for (long i = from; down ? (i < lines()) : (i >= 0); down ? i++ : i--)
{ {
lin = line(i); lin = line(i);
if (!casesens)
lin.lower();
if ((ret = lin.find(txt)) != -1) if ((ret = lin.find(txt)) != -1)
return i; return i;
} }

View File

@ -109,7 +109,8 @@ public:
// search and replace (una riga per volta, rispetta i formati) // search and replace (una riga per volta, rispetta i formati)
// txt = text to search; pos = int to put the char position in; // txt = text to search; pos = int to put the char position in;
// from = where to start; down = FALSE == up // from = where to start; down = FALSE == up
long search (const char* txt, int& pos, long from = 0, bool down = TRUE); long search (const char* txt, int& pos, long from = 0,
bool down = TRUE, bool casesens = FALSE);
// replace txt=txt in line=line at pos=pos for len=len // replace txt=txt in line=line at pos=pos for len=len
int replace(long line, const char* txt, int pos = 0, int len = -1); int replace(long line, const char* txt, int pos = 0, int len = -1);

View File

@ -14,18 +14,14 @@
#define MENU_BAR(i) (10000+i) #define MENU_BAR(i) (10000+i)
#define BAR_ITEM(i) (5000+100*i) #define BAR_ITEM(i) (5000+100*i)
#define MENU_ITEM(i) (30000+i) #define MENU_ITEM(i) (30000+i)
#define VISWIN_BAR (7000)
#define MENU_FILE 1100 #define MENU_VISWIN 7100
#define MENU_EDIT 1200 #define MENU_FILE BAR_ITEM(0)
#define MENU_ALT_EDIT 1300
#define M_EDIT_INSERT 1201 #define M_EDIT_SEARCH (M_EDIT+8)
#define M_EDIT_MODIFY 1202 #define M_EDIT_DELETE (M_EDIT+9)
#define M_EDIT_DELETE 1203 #define M_EDIT_QUIT (M_EDIT+10)
#define M_EDIT_SHOW 1204
#define M_EDIT_SEARCH 1205
#define M_EDIT_EDIT 1301
#if XVT_OS == XVT_OS_WIN #if XVT_OS == XVT_OS_WIN

View File

@ -21,7 +21,7 @@ extern "C"
} }
#endif #endif
#define BUTTONROW_SIZE (_toplevel ? 3 : 0) #define BUTTONROW_SIZE (_showbuts ? 3 : 0)
#define X_OFFSET (_rulers ? 6 : 1) #define X_OFFSET (_rulers ? 6 : 1)
#define Y_OFFSET (_rulers ? 1 : 0) #define Y_OFFSET (_rulers ? 1 : 0)
#define TEXTROWS (rows() - Y_OFFSET - BUTTONROW_SIZE) #define TEXTROWS (rows() - Y_OFFSET - BUTTONROW_SIZE)
@ -58,6 +58,19 @@ const long E_ADDLINE = 488L;
const long E_ADDLINE_ONSCREEN = 467L; const long E_ADDLINE_ONSCREEN = 467L;
void TViswin::check_menu_item(MENU_TAG item, bool on)
{
win_menu_check(win(), item, on);
win_update_menu_bar(win());
}
void TViswin::enable_menu_item(MENU_TAG item, bool on)
{
win_menu_enable(win(), item, on);
win_update_menu_bar(win());
}
void TViswin::exec_link() void TViswin::exec_link()
{ {
if (_linkID != -1) if (_linkID != -1)
@ -117,8 +130,11 @@ void TViswin::display_link (long y, long x1, long x2, const char *d)
#if XVT_OS == XVT_OS_WIN #if XVT_OS == XVT_OS_WIN
xvt_statbar_set(d); xvt_statbar_set(d);
#endif #endif
if (_link_button != -1) xvt_enable_control (_link_button, TRUE); if (_link_button != -1)
{
if (_showbuts) xvt_enable_control (_link_button, TRUE);
if (_toplevel) enable_menu_item(M_EDIT_CUT, TRUE);
}
if (!_toplevel && !_inside_linkexec) if (!_toplevel && !_inside_linkexec)
{ {
// chiama l'handler per maschere con FALSE come terzo parametro // chiama l'handler per maschere con FALSE come terzo parametro
@ -141,7 +157,11 @@ void TViswin::erase_link (long y, long x1, long x2)
xvt_statbar_set (""); xvt_statbar_set ("");
xvt_statbar_refresh (); xvt_statbar_refresh ();
#endif #endif
if (_link_button != -1) xvt_enable_control (_link_button, FALSE); if (_link_button != -1)
{
if (_showbuts) xvt_enable_control (_link_button, FALSE);
if (_toplevel) enable_menu_item(M_EDIT_CUT, FALSE);
}
} }
} }
@ -363,10 +383,8 @@ WINDOW TViswin::add_button (short id, const char *caption)
} }
void TViswin::repos_buttons () void TViswin::repos_buttons ()
{ {
if (!_toplevel) return;
if (!_toplevel) return;
for (int buttons = 0; _button[buttons] != NULL_WIN; buttons++) for (int buttons = 0; _button[buttons] != NULL_WIN; buttons++)
if (buttons == MAXBUT - 1) if (buttons == MAXBUT - 1)
{ {
@ -405,10 +423,11 @@ void TViswin::repos_buttons ()
void TViswin::open () void TViswin::open ()
{ {
set_scroll_max (MAXLEN, _txt.lines () <= _textrows ? _txt.lines () : _txt.lines () - _textrows); set_scroll_max (MAXLEN, _txt.lines () <= _textrows ? _txt.lines () : _txt.lines () - _textrows);
repos_buttons (); repos_buttons();
TScroll_window ::open (); TScroll_window::open();
show_buttons(_showbuts);
_need_update = TRUE; _need_update = TRUE;
force_update (); force_update ();
} }
// prints the window contents // prints the window contents
@ -769,7 +788,8 @@ void TViswin::paint_point (bool erase)
void TViswin::paint_header () void TViswin::paint_header ()
{ {
if (!_rulers) if (!_rulers)
return; return;
set_mode (M_COPY); set_mode (M_COPY);
set_opaque_text (TRUE); set_opaque_text (TRUE);
set_color (FOREGROUND, BACKGROUND); set_color (FOREGROUND, BACKGROUND);
@ -796,7 +816,7 @@ void TViswin::paint_selection ()
for (long l = p1.y; l <= p2.y; l++) for (long l = p1.y; l <= p2.y; l++)
{ {
int top, left, right; int top, left, right;
top = (int) (l - origin().y + 1); top = (int) (l - origin().y + Y_OFFSET);
if (top > 0 && top <= _textrows) if (top > 0 && top <= _textrows)
{ {
left = p1.y == l ? (int)(p1.x-origin().x + (long)X_OFFSET) : X_OFFSET; left = p1.y == l ? (int)(p1.x-origin().x + (long)X_OFFSET) : X_OFFSET;
@ -851,7 +871,7 @@ void TViswin::update ()
erase_point (); erase_point ();
autoscroll (FALSE); autoscroll (FALSE);
set_mode (M_COPY); set_mode (M_COPY);
if (_toplevel) if (_showbuts)
{ {
set_brush (BACKGROUND); set_brush (BACKGROUND);
bar ((X_OFFSET-1), rows()-BUTTONROW_SIZE, columns()+1, rows() + 1); bar ((X_OFFSET-1), rows()-BUTTONROW_SIZE, columns()+1, rows() + 1);
@ -875,13 +895,13 @@ void TViswin::update ()
// xvt_draw_rect(win(), r1, COLOR_WHITE, COLOR_GRAY, 2); // xvt_draw_rect(win(), r1, COLOR_WHITE, COLOR_GRAY, 2);
// xvt_draw_rect(win(), r2, COLOR_WHITE, COLOR_GRAY, 2); // xvt_draw_rect(win(), r2, COLOR_WHITE, COLOR_GRAY, 2);
} }
if (_toplevel) if (_showbuts)
bar ((X_OFFSET -1), rows()-BUTTONROW_SIZE, columns() + 1, rows() + 1); bar ((X_OFFSET -1), rows()-BUTTONROW_SIZE, columns() + 1, rows() + 1);
if (_toplevel && _isopen) if (_showbuts && _isopen)
paint_waitbar (FALSE); paint_waitbar (FALSE);
#if XVT_OS == XVT_OS_WIN #if XVT_OS == XVT_OS_WIN
else if (_toplevel) else if (_showbuts)
cpb_win_picture_draw_at (win(), _modpic, 4, cpb_win_picture_draw_at (win(), _modpic, 4,
4 + (int) (rows () - (long)BUTTONROW_SIZE) * CHARY); 4 + (int) (rows () - (long)BUTTONROW_SIZE) * CHARY);
#endif #endif
@ -945,6 +965,53 @@ void TViswin::handler (WINDOW win, EVENT * ep)
_textrows = TEXTROWS; _textrows = TEXTROWS;
_textcolumns = TEXTCOLUMNS; _textcolumns = TEXTCOLUMNS;
autoscroll (TRUE); autoscroll (TRUE);
break;
case E_COMMAND:
switch(ep->v.cmd.tag)
{
case M_EDIT_CLIPBOARD: // interrompi
dispatch_e_char(win, K_ESC);
break;
case M_EDIT_CUT: // collega
dispatch_e_char(win, CTRL_C);
break;
case M_EDIT_PASTE: // esporta
dispatch_e_char(win, CTRL_E);
break;
case M_EDIT_SEL_ALL: // stampa
dispatch_e_char(win, CTRL_S);
break;
case M_FONT: // mostra righelli
show_rulers(!_rulers);
check_menu_item(M_FONT, _rulers);
break;
case M_STYLE: // mostra bottoni
show_buttons(!_showbuts);
check_menu_item(M_STYLE, _showbuts);
break;
case M_EDIT_QUIT: // chiudi
#if XVT_OS == XVT_OS_WIN
xvt_statbar_set ("");
xvt_statbar_refresh ();
#endif
stop_run (K_ENTER);
break;
case M_EDIT_COPY: // copia
// ???
break;
case M_EDIT_CLEAR: // annulla selezione
dispatch_e_char(win,K_ENTER);
break;
case M_EDIT_SEARCH: // cerca
find();
break;
case M_EDIT_DELETE: // cerca il prossimo
find_next();
break;
case M_EDIT_UNDO: // ridisegna
refresh();
break;
}
break; break;
case E_CONTROL: case E_CONTROL:
if (ep->v.ctl.ci.type == WC_PUSHBUTTON) if (ep->v.ctl.ci.type == WC_PUSHBUTTON)
@ -985,7 +1052,7 @@ void TViswin::handler (WINDOW win, EVENT * ep)
} }
else if (ep->v.timer.id == _wtimer) else if (ep->v.timer.id == _wtimer)
{ {
if (_toplevel) paint_waitbar (); if (_showbuts) paint_waitbar ();
kill_timer (_wtimer); kill_timer (_wtimer);
if (_isopen) if (_isopen)
_wtimer = set_timer (win, 150l); _wtimer = set_timer (win, 150l);
@ -1873,11 +1940,15 @@ void TViswin::close_print ()
{ {
_isopen = FALSE; _isopen = FALSE;
kill_timer (_wtimer); kill_timer (_wtimer);
_need_update = TRUE; _need_update = TRUE;
if (_toplevel)
{
win_set_menu_text(win(), M_EDIT_QUIT, "Chiudi\tESC");
enable_menu_item(M_EDIT_CLIPBOARD, FALSE);
}
force_update (); force_update ();
} }
void TViswin::goto_end() void TViswin::goto_end()
{ {
goto_pos(0l, _txt.lines () - _textrows); goto_pos(0l, _txt.lines () - _textrows);
@ -1912,9 +1983,9 @@ void TViswin::refresh()
force_update(); force_update();
} }
long TViswin::search(const char* txt, int& pos, long from, bool down) long TViswin::search(const char* txt, int& pos, long from, bool down, bool cs)
{ {
return _txt.search(txt,pos,from,down); return _txt.search(txt,pos,from,down, cs);
} }
int TViswin::replace(long l, const char* txt, int pos, int len) int TViswin::replace(long l, const char* txt, int pos, int len)
@ -1933,17 +2004,17 @@ void TViswin::find()
TMask m("bagn005"); TMask m("bagn005");
m.set(F_STRING, _txt_to_find); m.set(F_STRING, _txt_to_find);
m.set(F_DIRECT, _down_dir ? "U" : "D"); m.set(F_DIRECT, _down_dir ? "D" : "U");
m.set(F_CASE, _case_sensitive ? "X" : ""); m.set(F_CASE, _case_sensitive ? "X" : "");
if (m.run() == K_ENTER) if (m.run() == K_ENTER)
{ {
_txt_to_find = m.get(F_STRING); _txt_to_find = m.get(F_STRING);
_down_dir = m.get_bool(F_DIRECT); _down_dir = m.get(F_DIRECT) == "D";
_case_sensitive = m.get_bool(F_CASE); _case_sensitive = !(m.get_bool(F_CASE));
int x; int x;
long l = search(_txt_to_find, x, _point.y, _down_dir); long l = search(_txt_to_find, x, _point.y, _down_dir, _case_sensitive);
if (l == -1l) if (l == -1l)
{ {
_last_found.y = -1l; _last_found.y = -1l;
@ -1956,6 +2027,7 @@ void TViswin::find()
_last_found.y = l; _last_found.y = l;
} }
} }
if (_toplevel) enable_menu_item(M_EDIT_DELETE, TRUE);
} }
void TViswin::find_next() void TViswin::find_next()
@ -1966,7 +2038,8 @@ void TViswin::find_next()
beep(); beep();
else else
{ {
long l = search(_txt_to_find, x, _point.y+(_down_dir ? 1l : -1l), _down_dir); long l = search(_txt_to_find, x, _point.y+(_down_dir ? 1l : -1l),
_down_dir, _case_sensitive);
if (l == -1) if (l == -1)
beep(); beep();
else else
@ -1974,6 +2047,29 @@ void TViswin::find_next()
} }
} }
void TViswin::show_rulers (bool on)
{
_rulers = on;
autoscroll (FALSE);
_textrows = TEXTROWS;
_textcolumns = TEXTCOLUMNS;
autoscroll (TRUE);
refresh();
}
void TViswin::show_buttons(bool on)
{
_showbuts = on;
autoscroll (FALSE);
_textrows = TEXTROWS;
_textcolumns = TEXTCOLUMNS;
autoscroll (TRUE);
for (int i = 0; i < _buttons; i++)
if (_button[i] != NULL_WIN)
show_window(_button[i],on);
refresh();
}
TViswin::TViswin(const char *fname, TViswin::TViswin(const char *fname,
const char *title, const char *title,
@ -1982,7 +2078,7 @@ TViswin::TViswin(const char *fname,
bool linkbutton, bool linkbutton,
int x, int y, int x, int y,
int height, int width, int height, int width,
bool rulers, bool rulers, // overridden by config parms
WINDOW parent, WINDOW parent,
TBrowsefile_field* brwfld): TBrowsefile_field* brwfld):
_filename (fname), _txt (fname, BUFFERSIZE), _islink (linkbutton), _isedit (editbutton), _filename (fname), _txt (fname, BUFFERSIZE), _islink (linkbutton), _isedit (editbutton),
@ -1991,7 +2087,8 @@ TViswin::TViswin(const char *fname,
_link_displayed (FALSE), _point_displayed (FALSE), _selecting (FALSE), _link_displayed (FALSE), _point_displayed (FALSE), _selecting (FALSE),
_scrolling (FALSE), _selflag (FALSE), _need_update (TRUE), _need_scroll (none), _scrolling (FALSE), _selflag (FALSE), _need_update (TRUE), _need_scroll (none),
_multiple (FALSE), _rulers(rulers), _txt_to_find(64), _multiple (FALSE), _rulers(rulers), _txt_to_find(64),
_frozen (FALSE), _brwfld(brwfld), _link_button(-1), _down_dir(TRUE) _frozen (FALSE), _brwfld(brwfld), _link_button(-1),
_down_dir(TRUE), _showbuts(FALSE)
{ {
if (title == NULL) if (title == NULL)
title = (fname ? fname : "Anteprima di stampa"); title = (fname ? fname : "Anteprima di stampa");
@ -2009,7 +2106,15 @@ TViswin::TViswin(const char *fname,
parent = TASK_WIN; parent = TASK_WIN;
_toplevel = parent == TASK_WIN; _toplevel = parent == TASK_WIN;
if (_toplevel)
{
// load info from config on buttons and rulers
TConfig cnf (CONFIG_GENERAL, "Visualizzazione");
_showbuts = cnf.get("Bottoni",NULL,-1,"X") == "X";
_rulers = cnf.get("Righelli",NULL,-1,"X") == "X";
}
const int larg = 76; const int larg = 76;
const int alt = 20; const int alt = 20;
@ -2037,10 +2142,20 @@ TViswin::TViswin(const char *fname,
} }
WIN_TYPE rt = _toplevel ? W_DOC : W_PLAIN; WIN_TYPE rt = _toplevel ? W_DOC : W_PLAIN;
create (x, y, maxlarg, maxalt, title, flags, rt, parent); create (x, y, maxlarg, maxalt, title, flags, rt, parent,
_toplevel ? VISWIN_BAR : 0);
set_opaque_text (TRUE); set_opaque_text (TRUE);
set_font (FF_FIXED); set_font (FF_FIXED);
if (_toplevel)
{
enable_menu_item(M_FONT, TRUE);
enable_menu_item(M_STYLE, TRUE);
check_menu_item(M_FONT, _rulers);
check_menu_item(M_STYLE, _showbuts);
enable_menu_item(M_EDIT_SEL_ALL, FALSE);
}
if (_txt.lines() > 0l) if (_txt.lines() > 0l)
set_scroll_max (MAXLEN - 1, _txt.lines () <= _textrows ? set_scroll_max (MAXLEN - 1, _txt.lines () <= _textrows ?
_txt.lines () : _txt.lines () - _textrows); _txt.lines () : _txt.lines () - _textrows);
@ -2061,23 +2176,19 @@ TViswin::TViswin(const char *fname,
{ {
_link_button = add_button (DLG_LINK, DLG_LINK_TITLE); _link_button = add_button (DLG_LINK, DLG_LINK_TITLE);
_buttons++; _buttons++;
xvt_enable_control (_link_button, FALSE); xvt_enable_control(_link_button, FALSE);
} }
if (_isprint) if (_isprint)
{ {
add_button (DLG_PRINT, DLG_PRINT_TITLE); add_button (DLG_PRINT, DLG_PRINT_TITLE);
_buttons++; _buttons++;
} }
//#if XVT_OS == XVT_OS_SCOUNIX
// maximize();
// #endif
} }
else _buttons = 0; else _buttons = 0;
_curbut = 0; _curbut = 0;
if (_isopen) if (_isopen && _showbuts)
_wtimer = set_timer(win(), 150l); _wtimer = set_timer(win(), 150l);
_point.set (0, 0); _point.set (0, 0);

View File

@ -87,7 +87,8 @@ class TViswin : public TScroll_window
bool _isbackground; bool _isbackground;
bool _frozen; bool _frozen;
bool _toplevel; bool _toplevel;
bool _rulers; bool _rulers;
bool _showbuts;
bool _inside_linkexec; bool _inside_linkexec;
// viene istanziato soltanto se e' usata come controllo BROWSEFILE // viene istanziato soltanto se e' usata come controllo BROWSEFILE
@ -133,6 +134,9 @@ protected:
virtual void update(); virtual void update();
virtual void handler(WINDOW win, EVENT* ep); virtual void handler(WINDOW win, EVENT* ep);
void check_menu_item(MENU_TAG item, bool on = TRUE);
void enable_menu_item(MENU_TAG item, bool on = TRUE);
public: public:
// gestione "collegamenti": vengono passati il testo completo, // gestione "collegamenti": vengono passati il testo completo,
@ -143,17 +147,21 @@ public:
void close_print(); void close_print();
bool frozen() { return _frozen; } bool frozen() { return _frozen; }
void abort_print(); void abort_print();
long lines() { return _txt.lines(); } long lines() { return _txt.lines(); }
void goto_end(); void goto_end();
void goto_top(); void goto_top();
void goto_pos(long r, long c, bool moveorigin = TRUE); void goto_pos(long r, long c, bool moveorigin = TRUE);
void refresh(); void refresh();
void show_rulers (bool on = TRUE);
void show_buttons(bool on = TRUE);
void add_line(const char* l); void add_line(const char* l);
// non_interactive search and replace // non_interactive search and replace
long search (const char* txt, int& pos, long from = 0, bool down = TRUE); long search (const char* txt, int& pos, long from = 0,
bool down = TRUE, bool casesens = FALSE);
int replace(long line, const char* txt, int pos = 0, int len = -1); int replace(long line, const char* txt, int pos = 0, int len = -1);
// interactive search // interactive search

View File

@ -75,9 +75,6 @@ HIDDEN void xvt_menu_enable(MENU_ITEM* m, bool on)
switch(m->tag) switch(m->tag)
{ {
case M_FILE: case M_FILE:
case MENU_FILE:
case MENU_EDIT:
case MENU_ALT_EDIT:
if (m->child) if (m->child)
xvt_menu_enable(m->child, on); xvt_menu_enable(m->child, on);
break; break;
@ -89,7 +86,6 @@ HIDDEN void xvt_menu_enable(MENU_ITEM* m, bool on)
case M_FILE_PRINT: case M_FILE_PRINT:
case M_FILE_PG_SETUP: case M_FILE_PG_SETUP:
case (M_FILE+11): case (M_FILE+11):
case M_EDIT_SEARCH:
break; // Leave them as they are break; // Leave them as they are
default: default:
win_menu_enable(TASK_WIN, m->tag, on); win_menu_enable(TASK_WIN, m->tag, on);
@ -199,7 +195,7 @@ WINDOW TWindow::create(short x, short y, short dx, short dy,
const char* title, long flags, WIN_TYPE wt, const char* title, long flags, WIN_TYPE wt,
WINDOW parent, int menu) WINDOW parent, int menu)
{ {
flags |= WSF_NO_MENUBAR; if (menu == 0) flags |= WSF_NO_MENUBAR;
if (parent == NULL_WIN) parent = TASK_WIN; if (parent == NULL_WIN) parent = TASK_WIN;
if (parent == TASK_WIN) flags |= WSF_INVISIBLE; if (parent == TASK_WIN) flags |= WSF_INVISIBLE;