Commit 0979e543 authored by claes's avatar claes

PageUp an PageDown implemented

parent 8a4699fc
...@@ -47,6 +47,14 @@ CoXHelp *CoXHelp::default_xhelp = 0; ...@@ -47,6 +47,14 @@ CoXHelp *CoXHelp::default_xhelp = 0;
// Prototype declarations // Prototype declarations
static void xhelp_open_URL_cb( void *ctx, char *url)
{
CoXHelp *xhelp = (CoXHelp *)ctx;
if ( xhelp->open_URL_cb)
(xhelp->open_URL_cb)( xhelp->parent_ctx, url);
}
static void xhelp_open_input_dialog( CoXHelp *xhelp, char *text, char *title, static void xhelp_open_input_dialog( CoXHelp *xhelp, char *text, char *title,
char *init_text, char *init_text,
void (*ok_cb)( CoXHelp *, char *)) void (*ok_cb)( CoXHelp *, char *))
...@@ -283,7 +291,7 @@ CoXHelp::CoXHelp( ...@@ -283,7 +291,7 @@ CoXHelp::CoXHelp(
xhelp_eUtility utility, xhelp_eUtility utility,
int *xa_sts) : int *xa_sts) :
parent_wid(xa_parent_wid), parent_ctx(xa_parent_ctx), parent_wid(xa_parent_wid), parent_ctx(xa_parent_ctx),
client_data(0), close_cb(0), set_focus_disabled(0), client_data(0), close_cb(0), open_URL_cb(0), set_focus_disabled(0),
displayed(0) displayed(0)
{ {
char uid_filename[120] = {"xtt_xhelp.uid"}; char uid_filename[120] = {"xtt_xhelp.uid"};
...@@ -373,6 +381,7 @@ CoXHelp::CoXHelp( ...@@ -373,6 +381,7 @@ CoXHelp::CoXHelp(
xhelpnav = new CoXHelpNav( (void *)this, xhelpnav_form, title, utility, &brow_widget, xhelpnav = new CoXHelpNav( (void *)this, xhelpnav_form, title, utility, &brow_widget,
&sts); &sts);
xhelpnav->open_URL_cb = xhelp_open_URL_cb;
// XtPopup( parent_wid, XtGrabNone); // XtPopup( parent_wid, XtGrabNone);
// displayed = 1; // displayed = 1;
......
...@@ -37,6 +37,7 @@ class CoXHelp { ...@@ -37,6 +37,7 @@ class CoXHelp {
Widget xhelpnav_form; Widget xhelpnav_form;
void *client_data; void *client_data;
void (*close_cb) ( void *, void *); void (*close_cb) ( void *, void *);
void (*open_URL_cb)( void *, char *);
int set_focus_disabled; int set_focus_disabled;
XtIntervalId focus_timerid; XtIntervalId focus_timerid;
int displayed; int displayed;
......
...@@ -64,8 +64,10 @@ static int xhelpnav_init_brow_cb( BrowCtx *ctx, void *client_data); ...@@ -64,8 +64,10 @@ static int xhelpnav_init_brow_cb( BrowCtx *ctx, void *client_data);
static int xhelpnav_init_brow_base_cb( FlowCtx *fctx, void *client_data); static int xhelpnav_init_brow_base_cb( FlowCtx *fctx, void *client_data);
static int help_cmp_items( const void *node1, const void *node2); static int help_cmp_items( const void *node1, const void *node2);
static void xhelpnav_open_URL( char *link) static void xhelpnav_open_URL( CoXHelpNav *xhelpnav, char *url)
{ {
if ( xhelpnav->open_URL_cb)
(xhelpnav->open_URL_cb)( xhelpnav->parent_ctx, url);
} }
// //
...@@ -288,7 +290,7 @@ CoXHelpNav::CoXHelpNav( ...@@ -288,7 +290,7 @@ CoXHelpNav::CoXHelpNav(
pwr_tStatus *status) : pwr_tStatus *status) :
parent_ctx(xn_parent_ctx), parent_wid(xn_parent_wid), parent_ctx(xn_parent_ctx), parent_wid(xn_parent_wid),
brow_cnt(0), closing_down(0), displayed(0), utility(xn_utility), brow_cnt(0), closing_down(0), displayed(0), utility(xn_utility),
search_node(0), search_strict(false) search_node(0), search_strict(false), open_URL_cb(0)
{ {
strcpy( name, xn_name); strcpy( name, xn_name);
strcpy( search_str, ""); strcpy( search_str, "");
...@@ -444,6 +446,14 @@ static int xhelpnav_brow_cb( FlowCtx *ctx, flow_tEvent event) ...@@ -444,6 +446,14 @@ static int xhelpnav_brow_cb( FlowCtx *ctx, flow_tEvent event)
free( node_list); free( node_list);
break; break;
} }
case flow_eEvent_Key_PageDown: {
brow_Page( xhelpnav->brow->ctx, 0.95);
break;
}
case flow_eEvent_Key_PageUp: {
brow_Page( xhelpnav->brow->ctx, -0.95);
break;
}
case flow_eEvent_Key_Return: case flow_eEvent_Key_Return:
case flow_eEvent_Key_Right: case flow_eEvent_Key_Right:
{ {
...@@ -794,7 +804,7 @@ int HItemHelpImage::doubleclick_action( CoXHelpNavBrow *brow, CoXHelpNav *xhelpn ...@@ -794,7 +804,7 @@ int HItemHelpImage::doubleclick_action( CoXHelpNavBrow *brow, CoXHelpNav *xhelpn
{ {
if ( (strstr( link, ".htm") != 0) || (strstr( link, ".pdf") != 0)) { if ( (strstr( link, ".htm") != 0) || (strstr( link, ".pdf") != 0)) {
// Open the url // Open the url
xhelpnav_open_URL( link); xhelpnav_open_URL( xhelpnav, link);
} }
else { else {
if ( file_name[0] == 0) if ( file_name[0] == 0)
...@@ -916,7 +926,7 @@ int HItemHelp::doubleclick_action( CoXHelpNavBrow *brow, CoXHelpNav *xhelpnav, d ...@@ -916,7 +926,7 @@ int HItemHelp::doubleclick_action( CoXHelpNavBrow *brow, CoXHelpNav *xhelpnav, d
{ {
if ( (strstr( link, ".htm") != 0) || (strstr( link, ".pdf") != 0)) { if ( (strstr( link, ".htm") != 0) || (strstr( link, ".pdf") != 0)) {
// Open the url // Open the url
xhelpnav_open_URL( link); xhelpnav_open_URL( xhelpnav, link);
} }
else { else {
if ( file_name[0] == 0) if ( file_name[0] == 0)
...@@ -983,7 +993,7 @@ int HItemHelpBold::doubleclick_action( CoXHelpNavBrow *brow, CoXHelpNav *xhelpna ...@@ -983,7 +993,7 @@ int HItemHelpBold::doubleclick_action( CoXHelpNavBrow *brow, CoXHelpNav *xhelpna
{ {
if ( (strstr( link, ".htm") != 0) || (strstr( link, ".pdf") != 0)) { if ( (strstr( link, ".htm") != 0) || (strstr( link, ".pdf") != 0)) {
// Open the url // Open the url
xhelpnav_open_URL( link); xhelpnav_open_URL( xhelpnav, link);
} }
else { else {
if ( file_name[0] == 0) if ( file_name[0] == 0)
......
...@@ -106,6 +106,7 @@ class CoXHelpNav { ...@@ -106,6 +106,7 @@ class CoXHelpNav {
brow_tNode search_node; brow_tNode search_node;
char search_str[80]; char search_str[80];
bool search_strict; bool search_strict;
void (*open_URL_cb)( void *, char *);
void print( char *filename); void print( char *filename);
void zoom( double zoom_factor); void zoom( double zoom_factor);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment