Add useful macros for widget type cast.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Этот коммит содержится в:
родитель
665d238ffa
Коммит
2ec122bc05
@ -57,7 +57,7 @@
|
||||
static cb_ret_t
|
||||
button_callback (Widget * w, Widget * sender, widget_msg_t msg, int parm, void *data)
|
||||
{
|
||||
WButton *b = (WButton *) w;
|
||||
WButton *b = BUTTON (w);
|
||||
WDialog *h = w->owner;
|
||||
int stop = 0;
|
||||
int off = 0;
|
||||
|
@ -8,6 +8,7 @@
|
||||
|
||||
/*** typedefs(not structures) and defined constants **********************************************/
|
||||
|
||||
#define BUTTON(x) ((WButton *)(x))
|
||||
|
||||
struct WButton;
|
||||
|
||||
|
@ -160,7 +160,7 @@ buttonbar_call (WButtonBar * bb, int i)
|
||||
static cb_ret_t
|
||||
buttonbar_callback (Widget * w, Widget * sender, widget_msg_t msg, int parm, void *data)
|
||||
{
|
||||
WButtonBar *bb = (WButtonBar *) w;
|
||||
WButtonBar *bb = BUTTONBAR (w);
|
||||
int i;
|
||||
const char *text;
|
||||
|
||||
@ -224,7 +224,7 @@ buttonbar_event (Gpm_Event * event, void *data)
|
||||
|
||||
if ((event->type & GPM_UP) != 0)
|
||||
{
|
||||
WButtonBar *bb = (WButtonBar *) data;
|
||||
WButtonBar *bb = BUTTONBAR (data);
|
||||
Gpm_Event local;
|
||||
int button;
|
||||
|
||||
@ -288,5 +288,5 @@ buttonbar_set_label (WButtonBar * bb, int idx, const char *text,
|
||||
WButtonBar *
|
||||
find_buttonbar (const WDialog * h)
|
||||
{
|
||||
return (WButtonBar *) find_widget_type (h, buttonbar_callback);
|
||||
return BUTTONBAR (find_widget_type (h, buttonbar_callback));
|
||||
}
|
||||
|
@ -8,6 +8,8 @@
|
||||
|
||||
/*** typedefs(not structures) and defined constants **********************************************/
|
||||
|
||||
#define BUTTONBAR(x) ((WButtonBar *)(x))
|
||||
|
||||
/* number of bttons in buttonbar */
|
||||
#define BUTTONBAR_LABELS_NUM 10
|
||||
|
||||
|
@ -56,7 +56,7 @@
|
||||
static cb_ret_t
|
||||
check_callback (Widget * w, Widget * sender, widget_msg_t msg, int parm, void *data)
|
||||
{
|
||||
WCheck *c = (WCheck *) w;
|
||||
WCheck *c = CHECK (w);
|
||||
|
||||
switch (msg)
|
||||
{
|
||||
|
@ -8,6 +8,8 @@
|
||||
|
||||
/*** typedefs(not structures) and defined constants **********************************************/
|
||||
|
||||
#define CHECK(x) ((WCheck *)(x))
|
||||
|
||||
#define C_BOOL 0x0001
|
||||
#define C_CHANGE 0x0002
|
||||
|
||||
|
@ -61,7 +61,7 @@
|
||||
static cb_ret_t
|
||||
gauge_callback (Widget * w, Widget * sender, widget_msg_t msg, int parm, void *data)
|
||||
{
|
||||
WGauge *g = (WGauge *) w;
|
||||
WGauge *g = GAUGE (w);
|
||||
WDialog *h = w->owner;
|
||||
|
||||
if (msg == MSG_INIT)
|
||||
|
@ -8,6 +8,8 @@
|
||||
|
||||
/*** typedefs(not structures) and defined constants **********************************************/
|
||||
|
||||
#define GAUGE(x) ((WGauge *)(x))
|
||||
|
||||
/*** enums ***************************************************************************************/
|
||||
|
||||
/*** structures declarations (and typedefs of structures)*****************************************/
|
||||
|
@ -55,7 +55,7 @@
|
||||
static cb_ret_t
|
||||
groupbox_callback (Widget * w, Widget * sender, widget_msg_t msg, int parm, void *data)
|
||||
{
|
||||
WGroupbox *g = (WGroupbox *) w;
|
||||
WGroupbox *g = GROUPBOX (w);
|
||||
|
||||
switch (msg)
|
||||
{
|
||||
|
@ -8,6 +8,8 @@
|
||||
|
||||
/*** typedefs(not structures) and defined constants **********************************************/
|
||||
|
||||
#define GROUPBOX(x) ((WGroupbox *)(x))
|
||||
|
||||
/*** enums ***************************************************************************************/
|
||||
|
||||
/*** structures declarations (and typedefs of structures)*****************************************/
|
||||
|
@ -369,9 +369,8 @@ history_show (GList ** history, Widget * widget, int current)
|
||||
z = NULL;
|
||||
for (hi = query_list->list; hi != NULL; hi = g_list_next (hi))
|
||||
{
|
||||
WLEntry *entry;
|
||||
WLEntry *entry = LENTRY (hi->data);
|
||||
|
||||
entry = (WLEntry *) hi->data;
|
||||
/* history is being reverted here again */
|
||||
z = g_list_prepend (z, entry->text);
|
||||
entry->text = NULL;
|
||||
|
@ -56,7 +56,7 @@
|
||||
static cb_ret_t
|
||||
hline_callback (Widget * w, Widget * sender, widget_msg_t msg, int parm, void *data)
|
||||
{
|
||||
WHLine *l = (WHLine *) w;
|
||||
WHLine *l = HLINE (w);
|
||||
WDialog *h = w->owner;
|
||||
|
||||
switch (msg)
|
||||
|
@ -8,6 +8,8 @@
|
||||
|
||||
/*** typedefs(not structures) and defined constants **********************************************/
|
||||
|
||||
#define HLINE(x) ((WHLine *)(x))
|
||||
|
||||
/*** enums ***************************************************************************************/
|
||||
|
||||
/*** structures declarations (and typedefs of structures)*****************************************/
|
||||
|
@ -831,7 +831,7 @@ static gboolean
|
||||
input_load_history (const gchar * event_group_name, const gchar * event_name,
|
||||
gpointer init_data, gpointer data)
|
||||
{
|
||||
WInput *in = (WInput *) init_data;
|
||||
WInput *in = INPUT (init_data);
|
||||
ev_history_load_save_t *ev = (ev_history_load_save_t *) data;
|
||||
const char *def_text;
|
||||
size_t buffer_len;
|
||||
@ -874,7 +874,7 @@ static gboolean
|
||||
input_save_history (const gchar * event_group_name, const gchar * event_name,
|
||||
gpointer init_data, gpointer data)
|
||||
{
|
||||
WInput *in = (WInput *) init_data;
|
||||
WInput *in = INPUT (init_data);
|
||||
|
||||
(void) event_group_name;
|
||||
(void) event_name;
|
||||
@ -928,7 +928,7 @@ input_destroy (WInput * in)
|
||||
static int
|
||||
input_event (Gpm_Event * event, void *data)
|
||||
{
|
||||
WInput *in = (WInput *) data;
|
||||
WInput *in = INPUT (data);
|
||||
Widget *w = WIDGET (data);
|
||||
|
||||
if (!mouse_global_in_widget (event, w))
|
||||
@ -983,7 +983,7 @@ input_event (Gpm_Event * event, void *data)
|
||||
static void
|
||||
input_set_options_callback (Widget * w, widget_options_t options, gboolean enable)
|
||||
{
|
||||
WInput *in = (WInput *) w;
|
||||
WInput *in = INPUT (w);
|
||||
|
||||
widget_default_set_options_callback (w, options, enable);
|
||||
if (in->label != NULL)
|
||||
@ -1059,7 +1059,7 @@ input_new (int y, int x, const int *input_colors, int width, const char *def_tex
|
||||
cb_ret_t
|
||||
input_callback (Widget * w, Widget * sender, widget_msg_t msg, int parm, void *data)
|
||||
{
|
||||
WInput *in = (WInput *) w;
|
||||
WInput *in = INPUT (w);
|
||||
cb_ret_t v;
|
||||
|
||||
switch (msg)
|
||||
|
@ -10,6 +10,8 @@
|
||||
|
||||
/*** typedefs(not structures) and defined constants **********************************************/
|
||||
|
||||
#define INPUT(x) ((WInput *)(x))
|
||||
|
||||
/* For history load-save functions */
|
||||
#define INPUT_LAST_TEXT ((char *) 2)
|
||||
|
||||
|
@ -1092,14 +1092,14 @@ query_callback (Widget * w, Widget * sender, widget_msg_t msg, int parm, void *d
|
||||
|
||||
new_end = str_get_prev_char (&input->buffer[end]) - input->buffer;
|
||||
|
||||
for (i = 0, e = ((WListbox *) h->current->data)->list;
|
||||
for (i = 0, e = LISTBOX (h->current->data)->list;
|
||||
e != NULL; i++, e = g_list_next (e))
|
||||
{
|
||||
WLEntry *le = (WLEntry *) e->data;
|
||||
WLEntry *le = LENTRY (e->data);
|
||||
|
||||
if (strncmp (input->buffer + start, le->text, new_end - start) == 0)
|
||||
{
|
||||
listbox_select_entry ((WListbox *) h->current->data, i);
|
||||
listbox_select_entry (LISTBOX (h->current->data), i);
|
||||
end = new_end;
|
||||
input_handle_char (input, parm);
|
||||
send_message (h->current->data, NULL, MSG_DRAW, 0, NULL);
|
||||
@ -1143,10 +1143,10 @@ query_callback (Widget * w, Widget * sender, widget_msg_t msg, int parm, void *d
|
||||
return MSG_HANDLED;
|
||||
}
|
||||
|
||||
for (i = 0, e = ((WListbox *) h->current->data)->list;
|
||||
for (i = 0, e = LISTBOX (h->current->data)->list;
|
||||
e != NULL; i++, e = g_list_next (e))
|
||||
{
|
||||
WLEntry *le = (WLEntry *) e->data;
|
||||
WLEntry *le = LENTRY (e->data);
|
||||
|
||||
if (strncmp (input->buffer + start, le->text, end - start) == 0
|
||||
&& strncmp (&le->text[end - start], buff, bl) == 0)
|
||||
@ -1154,7 +1154,7 @@ query_callback (Widget * w, Widget * sender, widget_msg_t msg, int parm, void *d
|
||||
if (need_redraw == 0)
|
||||
{
|
||||
need_redraw = 1;
|
||||
listbox_select_entry ((WListbox *) h->current->data, i);
|
||||
listbox_select_entry (LISTBOX (h->current->data), i);
|
||||
last_text = le->text;
|
||||
}
|
||||
else
|
||||
|
@ -59,7 +59,7 @@
|
||||
static cb_ret_t
|
||||
label_callback (Widget * w, Widget * sender, widget_msg_t msg, int parm, void *data)
|
||||
{
|
||||
WLabel *l = (WLabel *) w;
|
||||
WLabel *l = LABEL (w);
|
||||
WDialog *h = w->owner;
|
||||
|
||||
switch (msg)
|
||||
|
@ -8,6 +8,8 @@
|
||||
|
||||
/*** typedefs(not structures) and defined constants **********************************************/
|
||||
|
||||
#define LABEL(x) ((WLabel *)(x))
|
||||
|
||||
/*** enums ***************************************************************************************/
|
||||
|
||||
/*** structures declarations (and typedefs of structures)*****************************************/
|
||||
|
@ -161,7 +161,8 @@ listbox_draw (WListbox * l, gboolean focused)
|
||||
text = "";
|
||||
else
|
||||
{
|
||||
WLEntry *e = (WLEntry *) le->data;
|
||||
WLEntry *e = LENTRY (le->data);
|
||||
|
||||
text = e->text;
|
||||
le = g_list_next (le);
|
||||
pos++;
|
||||
@ -189,7 +190,7 @@ listbox_check_hotkey (WListbox * l, int key)
|
||||
|
||||
for (i = 0, le = l->list; le != NULL; i++, le = g_list_next (le))
|
||||
{
|
||||
WLEntry *e = (WLEntry *) le->data;
|
||||
WLEntry *e = LENTRY (le->data);
|
||||
|
||||
if (e->hotkey == key)
|
||||
return i;
|
||||
@ -367,7 +368,7 @@ listbox_destroy (WListbox * l)
|
||||
static cb_ret_t
|
||||
listbox_callback (Widget * w, Widget * sender, widget_msg_t msg, int parm, void *data)
|
||||
{
|
||||
WListbox *l = (WListbox *) w;
|
||||
WListbox *l = LISTBOX (w);
|
||||
WDialog *h = w->owner;
|
||||
cb_ret_t ret_code;
|
||||
|
||||
@ -441,7 +442,7 @@ listbox_callback (Widget * w, Widget * sender, widget_msg_t msg, int parm, void
|
||||
static int
|
||||
listbox_event (Gpm_Event * event, void *data)
|
||||
{
|
||||
WListbox *l = (WListbox *) data;
|
||||
WListbox *l = LISTBOX (data);
|
||||
Widget *w = WIDGET (data);
|
||||
|
||||
if (!mouse_global_in_widget (event, w))
|
||||
@ -553,7 +554,7 @@ listbox_search_text (WListbox * l, const char *text)
|
||||
|
||||
for (i = 0, le = l->list; le != NULL; i++, le = g_list_next (le))
|
||||
{
|
||||
WLEntry *e = (WLEntry *) le->data;
|
||||
WLEntry *e = LENTRY (le->data);
|
||||
|
||||
if (strcmp (e->text, text) == 0)
|
||||
return i;
|
||||
@ -632,7 +633,7 @@ listbox_get_current (WListbox * l, char **string, void **extra)
|
||||
gboolean ok;
|
||||
|
||||
if (l != NULL)
|
||||
e = (WLEntry *) g_list_nth_data (l->list, l->pos);
|
||||
e = LENTRY (g_list_nth_data (l->list, l->pos));
|
||||
|
||||
ok = (e != NULL);
|
||||
|
||||
@ -654,7 +655,7 @@ listbox_remove_current (WListbox * l)
|
||||
|
||||
current = g_list_nth (l->list, l->pos);
|
||||
l->list = g_list_remove_link (l->list, current);
|
||||
listbox_entry_free ((WLEntry *) current->data);
|
||||
listbox_entry_free (LENTRY (current->data));
|
||||
g_list_free_1 (current);
|
||||
l->count--;
|
||||
|
||||
|
@ -10,6 +10,9 @@
|
||||
|
||||
/*** typedefs(not structures) and defined constants **********************************************/
|
||||
|
||||
#define LISTBOX(x) ((WListbox *)(x))
|
||||
#define LENTRY(x) ((WLEntry *)(x))
|
||||
|
||||
/*** enums ***************************************************************************************/
|
||||
|
||||
/* callback should return one of the following values */
|
||||
|
@ -544,7 +544,7 @@ menubar_handle_key (WMenuBar * menubar, int key)
|
||||
static cb_ret_t
|
||||
menubar_callback (Widget * w, Widget * sender, widget_msg_t msg, int parm, void *data)
|
||||
{
|
||||
WMenuBar *menubar = (WMenuBar *) w;
|
||||
WMenuBar *menubar = MENUBAR (w);
|
||||
|
||||
switch (msg)
|
||||
{
|
||||
@ -606,7 +606,7 @@ menubar_callback (Widget * w, Widget * sender, widget_msg_t msg, int parm, void
|
||||
static int
|
||||
menubar_event (Gpm_Event * event, void *data)
|
||||
{
|
||||
WMenuBar *menubar = (WMenuBar *) data;
|
||||
WMenuBar *menubar = MENUBAR (data);
|
||||
Widget *w = WIDGET (data);
|
||||
gboolean was_active = TRUE;
|
||||
int left_x, right_x, bottom_y;
|
||||
@ -915,7 +915,7 @@ menubar_arrange (WMenuBar * menubar)
|
||||
WMenuBar *
|
||||
find_menubar (const WDialog * h)
|
||||
{
|
||||
return (WMenuBar *) find_widget_type (h, menubar_callback);
|
||||
return MENUBAR (find_widget_type (h, menubar_callback));
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
@ -11,6 +11,8 @@
|
||||
|
||||
/*** typedefs(not structures) and defined constants **********************************************/
|
||||
|
||||
#define MENUBAR(x) ((WMenuBar *)(x))
|
||||
|
||||
#define menu_separator_create() NULL
|
||||
|
||||
/*** enums ***************************************************************************************/
|
||||
|
@ -150,7 +150,7 @@ quick_create_labeled_input (GArray * widgets, int *y, int x, quick_widget_t * qu
|
||||
return;
|
||||
}
|
||||
|
||||
((WInput *) in.widget)->label = (WLabel *) label.widget;
|
||||
INPUT (in.widget)->label = LABEL (label.widget);
|
||||
/* cross references */
|
||||
label.quick_widget->u.label.input = in.quick_widget;
|
||||
in.quick_widget->u.input.label = label.quick_widget;
|
||||
@ -465,7 +465,7 @@ quick_dialog_skip (quick_dialog_t * quick_dlg, int nskip)
|
||||
|
||||
case quick_input:
|
||||
{
|
||||
Widget *label = WIDGET (((WInput *) item->widget)->label);
|
||||
Widget *label = WIDGET (INPUT (item->widget)->label);
|
||||
int width = column_width;
|
||||
|
||||
if (g != NULL)
|
||||
@ -495,12 +495,12 @@ quick_dialog_skip (quick_dialog_t * quick_dlg, int nskip)
|
||||
}
|
||||
|
||||
/* forced update internal variables of inpuit line */
|
||||
input_set_origin ((WInput *) (item->widget), item->widget->x, item->widget->cols);
|
||||
input_set_origin (INPUT (item->widget), item->widget->x, item->widget->cols);
|
||||
}
|
||||
break;
|
||||
|
||||
case quick_start_groupbox:
|
||||
g = (WGroupbox *) item->widget;
|
||||
g = GROUPBOX (item->widget);
|
||||
if (item->widget->x != x1)
|
||||
item->widget->x = x2;
|
||||
item->widget->cols = column_width;
|
||||
@ -517,20 +517,20 @@ quick_dialog_skip (quick_dialog_t * quick_dlg, int nskip)
|
||||
{
|
||||
Widget *wg = WIDGET (g);
|
||||
|
||||
((WHLine *) item->widget)->auto_adjust_cols = FALSE;
|
||||
HLINE (item->widget)->auto_adjust_cols = FALSE;
|
||||
item->widget->x = wg->x + 1 - WIDGET (wg->owner)->x;
|
||||
item->widget->cols = wg->cols;
|
||||
}
|
||||
else if (two_columns)
|
||||
{
|
||||
((WHLine *) item->widget)->auto_adjust_cols = FALSE;
|
||||
HLINE (item->widget)->auto_adjust_cols = FALSE;
|
||||
if (item->widget->x != x1)
|
||||
item->widget->x = x2;
|
||||
item->widget->x--;
|
||||
item->widget->cols = column_width + 2;
|
||||
}
|
||||
else
|
||||
((WHLine *) item->widget)->auto_adjust_cols = TRUE;
|
||||
HLINE (item->widget)->auto_adjust_cols = TRUE;
|
||||
}
|
||||
break;
|
||||
|
||||
@ -583,20 +583,19 @@ quick_dialog_skip (quick_dialog_t * quick_dlg, int nskip)
|
||||
switch (item->quick_widget->widget_type)
|
||||
{
|
||||
case quick_checkbox:
|
||||
*item->quick_widget->u.checkbox.state = ((WCheck *) item->widget)->state & C_BOOL;
|
||||
*item->quick_widget->u.checkbox.state = CHECK (item->widget)->state & C_BOOL;
|
||||
break;
|
||||
|
||||
case quick_input:
|
||||
if ((quick_widget->u.input.flags & 2) != 0)
|
||||
*item->quick_widget->u.input.result =
|
||||
tilde_expand (((WInput *) item->widget)->buffer);
|
||||
tilde_expand (INPUT (item->widget)->buffer);
|
||||
else
|
||||
*item->quick_widget->u.input.result =
|
||||
g_strdup (((WInput *) item->widget)->buffer);
|
||||
*item->quick_widget->u.input.result = g_strdup (INPUT (item->widget)->buffer);
|
||||
break;
|
||||
|
||||
case quick_radio:
|
||||
*item->quick_widget->u.radio.value = ((WRadio *) item->widget)->sel;
|
||||
*item->quick_widget->u.radio.value = RADIO (item->widget)->sel;
|
||||
break;
|
||||
|
||||
default:
|
||||
|
@ -56,7 +56,7 @@
|
||||
static cb_ret_t
|
||||
radio_callback (Widget * w, Widget * sender, widget_msg_t msg, int parm, void *data)
|
||||
{
|
||||
WRadio *r = (WRadio *) w;
|
||||
WRadio *r = RADIO (w);
|
||||
int i;
|
||||
|
||||
switch (msg)
|
||||
@ -153,7 +153,7 @@ radio_event (Gpm_Event * event, void *data)
|
||||
|
||||
if ((event->type & (GPM_DOWN | GPM_UP)) != 0)
|
||||
{
|
||||
WRadio *r = (WRadio *) data;
|
||||
WRadio *r = RADIO (data);
|
||||
Gpm_Event local;
|
||||
|
||||
local = mouse_get_local (event, w);
|
||||
|
@ -8,6 +8,8 @@
|
||||
|
||||
/*** typedefs(not structures) and defined constants **********************************************/
|
||||
|
||||
#define RADIO(x) ((WRadio *)(x))
|
||||
|
||||
/*** enums ***************************************************************************************/
|
||||
|
||||
/*** structures declarations (and typedefs of structures)*****************************************/
|
||||
|
@ -128,7 +128,7 @@ edit_save_mode_callback (Widget * w, Widget * sender, widget_msg_t msg, int parm
|
||||
Widget *ww;
|
||||
|
||||
ww = dlg_find_by_id (DIALOG (w), edit_save_mode_input_id);
|
||||
widget_disable (ww, ((WRadio *) sender)->sel != 2);
|
||||
widget_disable (ww, RADIO (sender)->sel != 2);
|
||||
return MSG_HANDLED;
|
||||
}
|
||||
|
||||
|
@ -661,7 +661,7 @@ edit_dialog_event (Gpm_Event * event, void *data)
|
||||
|
||||
w = WIDGET (find_menubar (h));
|
||||
|
||||
if (event->y == wh->y + 1 && (event->type & GPM_DOWN) != 0 && !((WMenuBar *) w)->is_active)
|
||||
if (event->y == wh->y + 1 && (event->type & GPM_DOWN) != 0 && !MENUBAR (w)->is_active)
|
||||
{
|
||||
/* menubar */
|
||||
|
||||
|
@ -570,7 +570,7 @@ advanced_chown_callback (Widget * w, Widget * sender, widget_msg_t msg, int parm
|
||||
if (f_pos > 2)
|
||||
break;
|
||||
flag_pos = f_pos * 3 + i; /* (strchr(ch_perm,parm)-ch_perm); */
|
||||
if (((WButton *) h->current->data)->text.start[(flag_pos % 3)] == '-')
|
||||
if (BUTTON (h->current->data)->text.start[(flag_pos % 3)] == '-')
|
||||
ch_flags[flag_pos] = '+';
|
||||
else
|
||||
ch_flags[flag_pos] = '-';
|
||||
|
@ -134,8 +134,8 @@ panel_listing_callback (Widget * w, Widget * sender, widget_msg_t msg, int parm,
|
||||
{
|
||||
WInput *in;
|
||||
|
||||
in = (WInput *) dlg_find_by_id (h, mini_user_format_id);
|
||||
input_assign_text (in, status_format[((WRadio *) wi)->sel]);
|
||||
in = INPUT (dlg_find_by_id (h, mini_user_format_id));
|
||||
input_assign_text (in, status_format[RADIO (wi)->sel]);
|
||||
dlg_stop (h);
|
||||
return MSG_HANDLED;
|
||||
}
|
||||
@ -169,7 +169,7 @@ panel_listing_callback (Widget * w, Widget * sender, widget_msg_t msg, int parm,
|
||||
{
|
||||
WRadio *r;
|
||||
|
||||
r = (WRadio *) dlg_find_by_id (h, panel_listing_types_id);
|
||||
r = RADIO (dlg_find_by_id (h, panel_listing_types_id));
|
||||
r->pos = r->sel = panel_listing_user_idx;
|
||||
dlg_select_widget (WIDGET (r)); /* force redraw */
|
||||
send_message (h, r, MSG_ACTION, 0, NULL);
|
||||
@ -185,15 +185,15 @@ panel_listing_callback (Widget * w, Widget * sender, widget_msg_t msg, int parm,
|
||||
WCheck *ch;
|
||||
WInput *in1, *in2;
|
||||
|
||||
in1 = (WInput *) dlg_find_by_id (h, panel_user_format_id);
|
||||
ch = (WCheck *) dlg_find_by_id (h, mini_user_status_id);
|
||||
in2 = (WInput *) dlg_find_by_id (h, mini_user_format_id);
|
||||
in1 = INPUT (dlg_find_by_id (h, panel_user_format_id));
|
||||
ch = CHECK (dlg_find_by_id (h, mini_user_status_id));
|
||||
in2 = INPUT (dlg_find_by_id (h, mini_user_format_id));
|
||||
|
||||
if (!(ch->state & C_BOOL))
|
||||
input_assign_text (in2, status_format[((WRadio *) sender)->sel]);
|
||||
input_assign_text (in2, status_format[RADIO (sender)->sel]);
|
||||
input_update (in2, FALSE);
|
||||
input_update (in1, FALSE);
|
||||
widget_disable (WIDGET (in1), ((WRadio *) sender)->sel != panel_listing_user_idx);
|
||||
widget_disable (WIDGET (in1), RADIO (sender)->sel != panel_listing_user_idx);
|
||||
return MSG_HANDLED;
|
||||
}
|
||||
|
||||
@ -201,9 +201,9 @@ panel_listing_callback (Widget * w, Widget * sender, widget_msg_t msg, int parm,
|
||||
{
|
||||
WInput *in;
|
||||
|
||||
in = (WInput *) dlg_find_by_id (h, mini_user_format_id);
|
||||
in = INPUT (dlg_find_by_id (h, mini_user_format_id));
|
||||
|
||||
if (((WCheck *) sender)->state & C_BOOL)
|
||||
if (CHECK (sender)->state & C_BOOL)
|
||||
{
|
||||
widget_disable (WIDGET (in), FALSE);
|
||||
input_assign_text (in, status_format[3]);
|
||||
@ -212,7 +212,7 @@ panel_listing_callback (Widget * w, Widget * sender, widget_msg_t msg, int parm,
|
||||
{
|
||||
WRadio *r;
|
||||
|
||||
r = (WRadio *) dlg_find_by_id (h, panel_listing_types_id);
|
||||
r = RADIO (dlg_find_by_id (h, panel_listing_types_id));
|
||||
widget_disable (WIDGET (in), TRUE);
|
||||
input_assign_text (in, status_format[r->sel]);
|
||||
}
|
||||
@ -254,7 +254,7 @@ sel_charset_button (WButton * button, int action)
|
||||
/* avoid strange bug with label repainting */
|
||||
g_snprintf (buf, sizeof (buf), "%-27s", cpname);
|
||||
w = dlg_find_by_id (WIDGET (button)->owner, disp_bits_name_id);
|
||||
label_set_text ((WLabel *) w, buf);
|
||||
label_set_text (LABEL (w), buf);
|
||||
}
|
||||
|
||||
return 0;
|
||||
@ -311,7 +311,7 @@ confvfs_callback (Widget * w, Widget * sender, widget_msg_t msg, int parm, void
|
||||
/* message from "Always use ftp proxy" checkbutton */
|
||||
if (sender != NULL && sender->id == ftpfs_always_use_proxy_id)
|
||||
{
|
||||
const gboolean not_use = !(((WCheck *) sender)->state & C_BOOL);
|
||||
const gboolean not_use = !(CHECK (sender)->state & C_BOOL);
|
||||
Widget *wi;
|
||||
|
||||
/* input */
|
||||
|
@ -337,8 +337,6 @@ enter (WInput * lc_cmdline)
|
||||
static cb_ret_t
|
||||
command_callback (Widget * w, Widget * sender, widget_msg_t msg, int parm, void *data)
|
||||
{
|
||||
WInput *cmd = (WInput *) w;
|
||||
|
||||
switch (msg)
|
||||
{
|
||||
case MSG_FOCUS:
|
||||
@ -348,7 +346,7 @@ command_callback (Widget * w, Widget * sender, widget_msg_t msg, int parm, void
|
||||
case MSG_KEY:
|
||||
/* Special case: we handle the enter key */
|
||||
if (parm == '\n')
|
||||
return enter (cmd);
|
||||
return enter (INPUT (w));
|
||||
/* fall through */
|
||||
|
||||
default:
|
||||
|
@ -1714,7 +1714,7 @@ do_find (const char *start_dir, ssize_t start_dir_len, const char *ignore_dirs,
|
||||
for (i = 0, entry = find_list->list; entry != NULL; i++, entry = g_list_next (entry))
|
||||
{
|
||||
const char *lc_filename = NULL;
|
||||
WLEntry *le = (WLEntry *) entry->data;
|
||||
WLEntry *le = LENTRY (entry->data);
|
||||
char *p;
|
||||
|
||||
if ((le->text == NULL) || (le->data == NULL))
|
||||
|
@ -70,7 +70,7 @@ configure_callback (Widget * w, Widget * sender, widget_msg_t msg, int parm, voi
|
||||
/* message from "Single press" checkbutton */
|
||||
if (sender != NULL && sender->id == configure_old_esc_mode_id)
|
||||
{
|
||||
const gboolean not_single = !(((WCheck *) sender)->state & C_BOOL);
|
||||
const gboolean not_single = !(CHECK (sender)->state & C_BOOL);
|
||||
Widget *ww;
|
||||
|
||||
/* input line */
|
||||
|
@ -181,7 +181,7 @@ learn_check_key (int c)
|
||||
|
||||
dlg_select_widget (learnkeys[i].button);
|
||||
/* TRANSLATORS: This label appears near learned keys. Keep it short. */
|
||||
label_set_text ((WLabel *) learnkeys[i].label, _("OK"));
|
||||
label_set_text (LABEL (learnkeys[i].label), _("OK"));
|
||||
learnkeys[i].ok = TRUE;
|
||||
learnok++;
|
||||
if (learnok >= learn_total)
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user