* wtools.c (dialog_repaint): Eliminate, nobody should be using
non-standard colors. Adjust all dependencies. (common_dialog_repaint): Fix return code. (query_callback): Eliminate, use common_dialog_callback() instead.
Этот коммит содержится в:
родитель
812e80c85a
Коммит
1f478c647a
@ -1,5 +1,11 @@
|
|||||||
2002-09-02 Pavel Roskin <proski@gnu.org>
|
2002-09-02 Pavel Roskin <proski@gnu.org>
|
||||||
|
|
||||||
|
* wtools.c (dialog_repaint): Eliminate, nobody should be using
|
||||||
|
non-standard colors. Adjust all dependencies.
|
||||||
|
(common_dialog_repaint): Fix return code.
|
||||||
|
(query_callback): Eliminate, use common_dialog_callback()
|
||||||
|
instead.
|
||||||
|
|
||||||
* listmode.c (listmode_refresh): Use common_dialog_repaint().
|
* listmode.c (listmode_refresh): Use common_dialog_repaint().
|
||||||
Eliminate all global variables. Reformat the whole file.
|
Eliminate all global variables. Reformat the whole file.
|
||||||
|
|
||||||
|
@ -145,15 +145,15 @@ static void remove_from_hotlist (struct hotlist *entry);
|
|||||||
|
|
||||||
#define new_hotlist() g_new0(struct hotlist, 1)
|
#define new_hotlist() g_new0(struct hotlist, 1)
|
||||||
|
|
||||||
static void hotlist_refresh (Dlg_head *dlg)
|
static void
|
||||||
|
hotlist_refresh (Dlg_head * dlg)
|
||||||
{
|
{
|
||||||
dialog_repaint (dlg, COLOR_NORMAL, COLOR_HOT_NORMAL);
|
common_dialog_repaint (dlg);
|
||||||
attrset (COLOR_NORMAL);
|
attrset (COLOR_NORMAL);
|
||||||
draw_box (dlg, 2, 5,
|
draw_box (dlg, 2, 5, dlg->lines - (hotlist_state.moving ? 6 : 10),
|
||||||
dlg->lines - (hotlist_state.moving ? 6 : 10),
|
dlg->cols - (UX * 2));
|
||||||
dlg->cols - (UX*2));
|
|
||||||
if (!hotlist_state.moving)
|
if (!hotlist_state.moving)
|
||||||
draw_box (dlg, dlg->lines-8, 5, 3, dlg->cols - (UX*2));
|
draw_box (dlg, dlg->lines - 8, 5, 3, dlg->cols - (UX * 2));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* If current->data is 0, then we are dealing with a VFS pathname */
|
/* If current->data is 0, then we are dealing with a VFS pathname */
|
||||||
|
32
src/wtools.c
32
src/wtools.c
@ -53,34 +53,30 @@
|
|||||||
/* {{{ Common dialog callback */
|
/* {{{ Common dialog callback */
|
||||||
|
|
||||||
void
|
void
|
||||||
dialog_repaint (struct Dlg_head *h, int back, int title_fore)
|
common_dialog_repaint (struct Dlg_head *h)
|
||||||
{
|
{
|
||||||
int space;
|
int space;
|
||||||
|
|
||||||
space = (h->flags & DLG_COMPACT) ? 0 : 1;
|
space = (h->flags & DLG_COMPACT) ? 0 : 1;
|
||||||
|
|
||||||
attrset (back);
|
attrset (NORMALC);
|
||||||
dlg_erase (h);
|
dlg_erase (h);
|
||||||
draw_box (h, space, space, h->lines - 2 * space, h->cols - 2 * space);
|
draw_box (h, space, space, h->lines - 2 * space, h->cols - 2 * space);
|
||||||
attrset (title_fore);
|
attrset (HOT_NORMALC);
|
||||||
if (h->title) {
|
if (h->title) {
|
||||||
dlg_move (h, space, (h->cols - strlen (h->title)) / 2);
|
dlg_move (h, space, (h->cols - strlen (h->title)) / 2);
|
||||||
addstr (h->title);
|
addstr (h->title);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
|
||||||
common_dialog_repaint (struct Dlg_head *h)
|
|
||||||
{
|
|
||||||
dialog_repaint (h, NORMALC, HOT_NORMALC);
|
|
||||||
}
|
|
||||||
|
|
||||||
int
|
int
|
||||||
common_dialog_callback (struct Dlg_head *h, int id, int msg)
|
common_dialog_callback (struct Dlg_head *h, int id, int msg)
|
||||||
{
|
{
|
||||||
if (msg == DLG_DRAW)
|
if (msg == DLG_DRAW) {
|
||||||
common_dialog_repaint (h);
|
common_dialog_repaint (h);
|
||||||
return 0;
|
return MSG_HANDLED;
|
||||||
|
}
|
||||||
|
return MSG_NOT_HANDLED;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* }}} */
|
/* }}} */
|
||||||
@ -154,17 +150,6 @@ int run_listbox (Listbox *l)
|
|||||||
|
|
||||||
|
|
||||||
/* {{{ Query Dialog functions */
|
/* {{{ Query Dialog functions */
|
||||||
static int query_callback (struct Dlg_head *h, int Id, int Msg)
|
|
||||||
{
|
|
||||||
switch (Msg){
|
|
||||||
case DLG_DRAW:
|
|
||||||
dialog_repaint (h, NORMALC, HOT_NORMALC);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Dlg_head *last_query_dlg;
|
Dlg_head *last_query_dlg;
|
||||||
|
|
||||||
static int sel_pos = 0;
|
static int sel_pos = 0;
|
||||||
@ -211,7 +196,8 @@ int query_dialog (char *header, char *text, int flags, int count, ...)
|
|||||||
|
|
||||||
/* prepare dialog */
|
/* prepare dialog */
|
||||||
query_dlg = create_dlg (ypos, xpos, lines, cols, query_colors,
|
query_dlg = create_dlg (ypos, xpos, lines, cols, query_colors,
|
||||||
query_callback, "[QueryBox]", "query", DLG_BACKWARD);
|
common_dialog_callback, "[QueryBox]",
|
||||||
|
"query", DLG_BACKWARD);
|
||||||
x_set_dialog_title (query_dlg, header);
|
x_set_dialog_title (query_dlg, header);
|
||||||
|
|
||||||
if (count > 0){
|
if (count > 0){
|
||||||
|
@ -1,12 +1,11 @@
|
|||||||
#ifndef __WTOOLS_H
|
#ifndef __WTOOLS_H
|
||||||
#define __WTOOLS_H
|
#define __WTOOLS_H
|
||||||
|
|
||||||
/* Dialog default background repaint routines */
|
/* Repaint the area, the frame and the title */
|
||||||
void dialog_repaint (struct Dlg_head *h, int back, int title_fore);
|
|
||||||
void common_dialog_repaint (struct Dlg_head *h);
|
void common_dialog_repaint (struct Dlg_head *h);
|
||||||
|
|
||||||
/* For common dialogs, just repaint background */
|
/* For common dialogs, just repaint */
|
||||||
int common_dialog_callback (struct Dlg_head *h, int id, int msg);
|
int common_dialog_callback (struct Dlg_head *h, int id, int msg);
|
||||||
|
|
||||||
/* Listbox utility functions */
|
/* Listbox utility functions */
|
||||||
typedef struct {
|
typedef struct {
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user