1 /*
2  *  This file is part of XForms.
3  *
4  *  XForms is free software; you can redistribute it and/or modify it
5  *  under the terms of the GNU Lesser General Public License as
6  *  published by the Free Software Foundation; either version 2.1, or
7  *  (at your option) any later version.
8  *
9  *  XForms is distributed in the hope that it will be useful, but
10  *  WITHOUT ANY WARRANTY; without even the implied warranty of
11  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12  *  Lesser General Public License for more details.
13  *
14  *  You should have received a copy of the GNU Lesser General Public
15  *  License along with XForms; see the file COPYING.  If not, write to
16  *  the Free Software Foundation, 59 Temple Place - Suite 330, Boston,
17  *  MA 02111-1307, USA.
18  */
19 
20 
21 /*
22  * scrollbar functionality check-out
23  */
24 
25 #ifdef HAVE_CONFIG_H
26 #include "config.h"
27 #endif
28 
29 #include "include/forms.h"
30 #include <stdlib.h>
31 #include "fd/scrollbar_gui.h"   /* from fd/ directory */
32 
33 
34 /***************************************
35  ***************************************/
36 
hide_cb(FL_OBJECT * ob,long data FL_UNUSED_ARG)37 void hide_cb( FL_OBJECT * ob,
38               long        data  FL_UNUSED_ARG )
39 {
40     FD_scb *fdui = ob->form->fdui;
41 
42     if ( fl_object_is_visible( fdui->hor_thin ) )
43     {
44         fl_set_object_label( fdui->hide,"Show" );
45         fl_hide_object( fdui->hor_thin );
46     }
47     else
48     {
49         fl_set_object_label( fdui->hide,"Hide" );
50         fl_show_object( fdui->hor_thin );
51     }
52 }
53 
54 
55 /***************************************
56  ***************************************/
57 
deactivate_cb(FL_OBJECT * ob,long data FL_UNUSED_ARG)58 void deactivate_cb( FL_OBJECT * ob,
59                     long        data  FL_UNUSED_ARG )
60 {
61     FD_scb *fdui = ob->form->fdui;
62 
63     if ( fl_object_is_active( fdui->hor_thin ) )
64     {
65         fl_set_object_label( fdui->deactivate,"Activate" );
66         fl_deactivate_object( fdui->hor_thin );
67     }
68     else
69     {
70         fl_set_object_label( fdui->deactivate,"Deactivate" );
71         fl_activate_object( fdui->hor_thin );
72     }
73 }
74 
75 
76 /***************************************
77  ***************************************/
78 
done_cb(FL_OBJECT * ob FL_UNUSED_ARG,long data FL_UNUSED_ARG)79 void done_cb( FL_OBJECT * ob    FL_UNUSED_ARG,
80               long        data  FL_UNUSED_ARG )
81 {
82     fl_finish( );
83     exit( 0 );
84 }
85 
86 
87 /***************************************
88  ***************************************/
89 
noop_cb(FL_OBJECT * ob FL_UNUSED_ARG,long data FL_UNUSED_ARG)90 void noop_cb( FL_OBJECT * ob    FL_UNUSED_ARG,
91               long        data  FL_UNUSED_ARG )
92 {
93 }
94 
95 
96 /***************************************
97  ***************************************/
98 
main(int argc,char * argv[])99 int main( int    argc,
100           char * argv[ ] )
101 {
102     FD_scb *fd_scb;
103 
104     fl_initialize( &argc, argv, 0, 0, 0 );
105     fd_scb = create_form_scb( );
106 
107     fl_show_form( fd_scb->scb, FL_PLACE_CENTERFREE, FL_FULLBORDER, "form0" );
108 
109     fl_do_forms( );
110     fl_finish( );
111 
112     return 0;
113 }
114 
115 
116 /*
117  * Local variables:
118  * tab-width: 4
119  * indent-tabs-mode: nil
120  * End:
121  */
122