PIPS
|
#include <stdio.h>
#include <sys/time.h>
#include <sys/resource.h>
#include <xview/xview.h>
#include <xview/panel.h>
#include <xview/text.h>
#include "genC.h"
#include "misc.h"
#include "wpips.h"
Go to the source code of this file.
Enumerations | |
enum | { ABBREV_MENU_WITH_TEXT_AFTER_SELECTION = 9841 , ABBREV_MENU_WITH_TEXT_GENERATE_MENU = 1431 } |
Single choice handling. More... | |
Functions | |
static void | schoose_help_notify (Panel_item item, Event *event) |
static void | schoose_ok_notify (Panel_item item, Event *event) |
Cette routine est appelé d'une part lorsqu'on a cliqué sur OK pour valider un nom tapé textuellement, d'autre part lorsqu'on clique sur un choix. More... | |
void | schoose_close () |
schoose_close() can be called even when schoose window is already closed. More... | |
void | schoose_cancel_notify (Panel_item item, Event *event) |
static int | schoose_choice_notify (Panel_item item, char *item_string, Xv_opaque client_data, Panel_list_op op, Event *event, int row) |
Function used to update the text panel according to the list panel: More... | |
static void | schoose_frame_done_proc (Frame frame) |
Avoid the schoose_frame destruction and act as cancel: More... | |
void | schoose (char *title, gen_array_t array, char *initial_choice, void(*function_for_ok)(char *), void(*function_for_cancel)(void)) |
static void | schoose_abbrev_menu_with_text_text_notify (Panel_item text_item, Event *event) |
Accept only typed text in the menu list: More... | |
static void | abbrev_menu_with_text_menu_notify (Menu menu, Menu_item menu_item) |
The function that calls the real user notifying function: More... | |
static Notify_value | abbrev_menu_event_filter_proc (Panel panel, Event *event, Notify_arg arg, Notify_event_type type) |
Panel_item | schoose_create_abbrev_menu_with_text (Panel main_panel, char *label_string, int value_display_length, int x, int y, Menu(*generate_menu)(void), void(*after_selection)(char *)) |
Create an abbreviation menu attached with a text item. More... | |
void | create_schoose_window () |
Variables | |
static Panel_item | choice |
static Panel_item | choices |
static Panel_item | ok |
static Panel_item | help |
static Panel_item | cancel |
static void(* | apply_on_choice )(char *) |
static void(* | apply_on_cancel )(void) |
anonymous enum |
Single choice handling.
Difference with previous release: 1/ schoose_close() must be called in order to close the schoose window. 2/ schoose() has one more argument, because cancel button is created. bb 04.06.91
Enumerator | |
---|---|
ABBREV_MENU_WITH_TEXT_AFTER_SELECTION | |
ABBREV_MENU_WITH_TEXT_GENERATE_MENU |
Definition at line 48 of file xv_schoose2.c.
|
static |
See example p. 675 in the XView Programming Manual:
Find the Panel_item
OK, we clicked on a abbrev_menu_with_text menu:
If there is an old menu, remove it:
Create the new menu:
menu_return_value() seems to be the default MENU_NOTIFY_PROC in XView... Hum, internal details...
Quite strange: with gcc without -static on SunOS4.1.4, this test is never true... :-( Well, remove this micro-optimization and always reinstall the MENU_NOTIFY_PROC:
The new_menu has not attached a notify procedure. Get the one given at creation time of the panel:
Associate the real notify function to the menu too:
Now call the normal event procedure:
Definition at line 268 of file xv_schoose2.c.
References ABBREV_MENU_WITH_TEXT_AFTER_SELECTION, ABBREV_MENU_WITH_TEXT_GENERATE_MENU, abbrev_menu_with_text_menu_notify(), debug(), debug_off, and debug_on.
Referenced by schoose_create_abbrev_menu_with_text().
|
static |
The function that calls the real user notifying function:
Definition at line 250 of file xv_schoose2.c.
References debug(), debug_off, and debug_on.
Referenced by abbrev_menu_event_filter_proc().
void create_schoose_window | ( | ) |
Avoid the schoose_frame destruction:
Definition at line 414 of file xv_schoose2.c.
References cancel, choice, choices, help, hide_window(), main_frame, ok, schoose_cancel_notify(), schoose_choice_notify(), schoose_frame, schoose_frame_done_proc(), schoose_help_notify(), schoose_ok_notify(), and schoose_panel.
void schoose | ( | char * | title, |
gen_array_t | array, | ||
char * | initial_choice, | ||
void(*)(char *) | function_for_ok, | ||
void(*)(void) | function_for_cancel | ||
) |
reset the choice set to empty
Delete all the rows, ie nchoices rows from row 0:
Initialise au choix initial ou à défaut le premier :
move the pointer to the center of the query window
Definition at line 177 of file xv_schoose2.c.
References apply_on_cancel, apply_on_choice, array, choice, choices, gen_array_item(), gen_array_nitems(), int, pointer_in_center_of_frame(), schoose_frame, and unhide_window().
|
static |
Accept only typed text in the menu list:
event | int Value, ? |
Definition at line 228 of file xv_schoose2.c.
References ABBREV_MENU_WITH_TEXT_AFTER_SELECTION, debug(), debug_off, and debug_on.
Referenced by schoose_create_abbrev_menu_with_text().
void schoose_cancel_notify | ( | Panel_item | item, |
Event * | event | ||
) |
Definition at line 126 of file xv_schoose2.c.
References schoose_close().
Referenced by create_schoose_window().
|
static |
Function used to update the text panel according to the list panel:
Avoid deletion and insertion with the edit menu of button 3:
Accept the operation by default:
Definition at line 136 of file xv_schoose2.c.
References choice, and pips_assert.
Referenced by create_schoose_window().
void schoose_close | ( | ) |
schoose_close() can be called even when schoose window is already closed.
Delete all the rows, ie nchoices rows from row 0:
Definition at line 108 of file xv_schoose2.c.
References choice, choices, hide_window(), int, and schoose_frame.
Referenced by schoose_cancel_notify(), and schoose_ok_notify().
Panel_item schoose_create_abbrev_menu_with_text | ( | Panel | main_panel, |
char * | label_string, | ||
int | value_display_length, | ||
int | x, | ||
int | y, | ||
Menu(*)(void) | generate_menu, | ||
void(*)(char *) | after_selection | ||
) |
Create an abbreviation menu attached with a text item.
after_selection() is called when a selection is done or a text has been entered. It can be seen as a new widget.
No real menu yet:
Strange, 21 does a Program received signal SIGSEGV, Segmentation fault. 0x1cf988 in attr_check_use_custom ()
PANEL_ITEM_X_GAP, 22,
Definition at line 365 of file xv_schoose2.c.
References abbrev_menu_event_filter_proc(), ABBREV_MENU_WITH_TEXT_AFTER_SELECTION, ABBREV_MENU_WITH_TEXT_GENERATE_MENU, main_panel, schoose_abbrev_menu_with_text_text_notify(), and x.
Referenced by create_status_subwindow().
|
static |
Avoid the schoose_frame destruction and act as cancel:
Definition at line 169 of file xv_schoose2.c.
References hide_window().
Referenced by create_schoose_window().
|
static |
Definition at line 60 of file xv_schoose2.c.
References display_help().
Referenced by create_schoose_window().
|
static |
Cette routine est appelé d'une part lorsqu'on a cliqué sur OK pour valider un nom tapé textuellement, d'autre part lorsqu'on clique sur un choix.
Suppose qu'item et event sont folklo car on peut être appelé par schoose_choice_notify
Modified to verify that an correct item is selected. RK, 21/05/1993.
Normal case :
Definition at line 70 of file xv_schoose2.c.
References choice, choices, free(), int, prompt_user(), schoose_close(), and strdup().
Referenced by create_schoose_window().
|
static |
Definition at line 57 of file xv_schoose2.c.
Referenced by schoose().
|
static |
Definition at line 56 of file xv_schoose2.c.
Referenced by schoose().
|
static |
Definition at line 54 of file xv_schoose2.c.
Referenced by create_schoose_window().
|
static |
Definition at line 54 of file xv_schoose2.c.
Referenced by ComputeNewSizeOfIthDimension(), create_schoose_window(), dag_split_on_scalars(), freia_terapix_call(), schoose(), schoose_choice_notify(), schoose_close(), schoose_ok_notify(), and select_imagelet().
|
static |
Definition at line 54 of file xv_schoose2.c.
Referenced by create_schoose_window(), schoose(), schoose_close(), and schoose_ok_notify().
|
static |
Definition at line 54 of file xv_schoose2.c.
Referenced by create_schoose_window().
|
static |
Definition at line 54 of file xv_schoose2.c.
Referenced by create_schoose_window().