Commit 0979e543 authored by claes's avatar claes

PageUp an PageDown implemented

parent 8a4699fc
......@@ -47,6 +47,14 @@ CoXHelp *CoXHelp::default_xhelp = 0;
// 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,
char *init_text,
void (*ok_cb)( CoXHelp *, char *))
......@@ -283,7 +291,7 @@ CoXHelp::CoXHelp(
xhelp_eUtility utility,
int *xa_sts) :
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)
{
char uid_filename[120] = {"xtt_xhelp.uid"};
......@@ -373,6 +381,7 @@ CoXHelp::CoXHelp(
xhelpnav = new CoXHelpNav( (void *)this, xhelpnav_form, title, utility, &brow_widget,
&sts);
xhelpnav->open_URL_cb = xhelp_open_URL_cb;
// XtPopup( parent_wid, XtGrabNone);
// displayed = 1;
......
......@@ -37,6 +37,7 @@ class CoXHelp {
Widget xhelpnav_form;
void *client_data;
void (*close_cb) ( void *, void *);
void (*open_URL_cb)( void *, char *);
int set_focus_disabled;
XtIntervalId focus_timerid;
int displayed;
......
......@@ -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 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(
pwr_tStatus *status) :
parent_ctx(xn_parent_ctx), parent_wid(xn_parent_wid),
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( search_str, "");
......@@ -444,6 +446,14 @@ static int xhelpnav_brow_cb( FlowCtx *ctx, flow_tEvent event)
free( node_list);
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_Right:
{
......@@ -794,7 +804,7 @@ int HItemHelpImage::doubleclick_action( CoXHelpNavBrow *brow, CoXHelpNav *xhelpn
{
if ( (strstr( link, ".htm") != 0) || (strstr( link, ".pdf") != 0)) {
// Open the url
xhelpnav_open_URL( link);
xhelpnav_open_URL( xhelpnav, link);
}
else {
if ( file_name[0] == 0)
......@@ -916,7 +926,7 @@ int HItemHelp::doubleclick_action( CoXHelpNavBrow *brow, CoXHelpNav *xhelpnav, d
{
if ( (strstr( link, ".htm") != 0) || (strstr( link, ".pdf") != 0)) {
// Open the url
xhelpnav_open_URL( link);
xhelpnav_open_URL( xhelpnav, link);
}
else {
if ( file_name[0] == 0)
......@@ -983,7 +993,7 @@ int HItemHelpBold::doubleclick_action( CoXHelpNavBrow *brow, CoXHelpNav *xhelpna
{
if ( (strstr( link, ".htm") != 0) || (strstr( link, ".pdf") != 0)) {
// Open the url
xhelpnav_open_URL( link);
xhelpnav_open_URL( xhelpnav, link);
}
else {
if ( file_name[0] == 0)
......
......@@ -106,6 +106,7 @@ class CoXHelpNav {
brow_tNode search_node;
char search_str[80];
bool search_strict;
void (*open_URL_cb)( void *, char *);
void print( char *filename);
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