Main Page | Namespace List | Class Hierarchy | Class List | File List | Class Members | File Members | Related Pages

hk_classes/hk_classes/hk_visible.h

Go to the documentation of this file.
00001 // ****************************************************************************
00002 // copyright (c) 2000-2005 Horst Knorr <hk_classes@knoda.org>
00003 // This file is part of the hk_classes library.
00004 // This file may be distributed and/or modified under the terms of the
00005 // GNU Library Public License version 2 as published by the Free Software
00006 // Foundation and appearing in the file COPYING included in the
00007 // packaging of this file.
00008 // This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
00009 // WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
00010 // ****************************************************************************
00011 #ifndef HK_VISIBLE
00012 #define HK_VISIBLE
00013 #include "hk_definitions.h"
00014 #include "hk_class.h"
00015 #include "hk_colour.h"
00016 #include "hk_font.h"
00017 #include "hk_key.h"
00018 
00019 using namespace std;
00020 
00021 class hk_presentation;
00022 class hk_form;
00023 class hk_report;
00024 class hk_visiblemodeprivate;
00025 class hk_visibleprivate;
00026 class hk_tabvisible;
00035 class hk_visible:public hk_class
00036 
00037 {
00038     friend class hk_presentation;
00039     friend class hk_form;
00040     friend class hk_reportdata;
00041     friend class hk_tabvisible;
00042     public:
00043         hk_visible(hk_presentation* p=NULL);
00044         virtual     ~hk_visible(void);
00048         void        set_x(unsigned int px, bool registerchange=true);
00052         void        set_y(unsigned int py, bool registerchange=true);
00056         void        set_width(unsigned int w, bool registerchange=true);
00060         void        set_height(unsigned int h, bool registerchange=true);
00061         unsigned int    x(void) const;
00062         unsigned int    y(void) const;
00063         unsigned int    width(void)const;
00064         unsigned int    height(void) ;
00068         void        set_size(unsigned int x, unsigned int y,unsigned int w, unsigned int h, bool registerchange=true);
00069         void        set_size(unsigned int x, unsigned int y,unsigned int w, unsigned int h, bool registerchange,bool force_setting);
00070         void        set_size(unsigned int width, unsigned int height, bool registerchange=true);
00071         void        set_position(unsigned int x, unsigned int y, bool registerchange=true);
00076         void        set_label(const hk_string& l, bool registerchange=true);
00077         void        set_label(const hk_string& l, bool registerchange,bool force_setting);
00078         hk_string       label(void);
00083         bool set_identifier(const hk_string&,bool registerchange=true,enum_interaction=interactive);
00084         hk_string identifier(void) const;
00085 
00086 
00087         enum enum_visibletype {textlabel,button,rowselector,boolean,lineedit,memo,combobox,grid,form,report,reportsection,reportdata,query,subform,image,date,tabvisible,other};
00088         enum_visibletype  type(void) {return p_visibletype;}
00092         void       set_font(const hk_string& font,int size,bool registerchange=true);
00093         void       set_font(const hk_string& font,int size,bool registerchange,bool force_setting);
00094         void       set_font(const hk_font& font,bool registerchange=true);
00095         void       set_font(const hk_font& font,bool registerchange,bool force_setting);
00096 
00097         virtual hk_font     font(void);
00101         void   set_foregroundcolour(const hk_colour& colour,bool registerchange=true);
00102         void   set_foregroundcolour(const hk_colour& colour,bool registerchange,bool force_setting);
00103         hk_colour foregroundcolour(void);
00107         void   set_backgroundcolour(const hk_colour& colour,bool registerchange=true);
00108         void   set_backgroundcolour(const hk_colour& colour,bool registerchange,bool force_setting);
00109         hk_colour backgroundcolour(void);
00110 
00116         void set_neverregisterchange(bool n);
00117         void set_neverregisterchange(bool n,bool force_setting);
00118         bool neverregisterchange(void);
00119         virtual void savedata(ostream& s );
00120         virtual void loaddata(const hk_string& definition);
00124         long  presentationnumber(void) const;
00125         void set_datetimeformat(const hk_string& datetime,const hk_string& date, const hk_string&  time);
00126         void set_datetimeformat(const hk_string& datetime,const hk_string& date, const hk_string&  time,bool force_setting);
00127         hk_string datetimeformat(void);
00128         hk_string dateformat(void);
00129         hk_string timeformat(void);
00130         void set_counts_as(unsigned long int c);
00131         virtual void set_counts_as(unsigned long int c,bool force_setting);
00132         virtual unsigned long int counts_as(void);
00133         virtual hk_string replace(const hk_string& where);
00134         hk_presentation* presentation(void);
00135 
00140         void set_load_presentationnumber(bool l);
00141         void set_load_presentationnumber(bool l,bool force_setting);
00142         bool load_presentationnumber(void);
00146         enum alignmenttype{alignleft,alignright,aligncenter,aligndefault};
00150         void set_alignment(alignmenttype a,bool registerchange=true);
00151         void set_alignment(alignmenttype a,bool registerchange,bool force_setting);
00152         alignmenttype alignment(void);
00153 
00158         static void set_defaulttextalignment(alignmenttype a);
00159         static alignmenttype defaulttextalignment(void);
00164         static void set_defaultnumberalignment(alignmenttype a);
00165         static alignmenttype defaultnumberalignment(void);
00169         static void set_open_maximized_windows(bool m);
00170         static bool open_maximized_windows(void);
00171 
00172 
00176 void set_tooltip(const hk_string&,bool registerchange=true,bool force_setting=false);
00180 hk_string tooltip(void);
00181 
00182 
00183 
00184 virtual void show_widget(void);
00185 virtual void hide_widget(void);
00186 virtual bool close_widget(void);
00187 
00188 
00189 
00193         virtual void lower_widget(bool registerchange=true);
00197         virtual void raise_widget(bool registerchange=true);
00198 
00202         void set_on_click_action(const hk_string&,bool registerchange=true,bool force_setting=true);
00206         hk_string on_click_action(void);
00210         void set_on_doubleclick_action(const hk_string&,bool registerchange=true,bool force_setting=true);
00214         hk_string on_doubleclick_action(void);
00220         void set_on_open_action(const hk_string&,bool registerchange=true,bool force_setting=true);
00224         hk_string on_open_action(void);
00229         void set_on_close_action(const hk_string&,bool registerchange=true,bool force_setting=true);
00233         hk_string on_close_action(void);
00234 
00240 void set_on_getfocus_action(const hk_string&,bool registerchange=true,bool force_setting=true);
00245 hk_string on_getfocus_action(void);
00246 
00252 void set_on_loosefocus_action(const hk_string&,bool registerchange=true,bool force_setting=true);
00257 hk_string on_loosefocus_action(void);
00258 
00259 
00260 void set_on_key_action(const hk_string&,bool registerchange=true,bool force_setting=true);
00265 hk_string on_key_action(void);
00266 void set_key(const hk_key&);
00270 hk_key* key() const;
00271 
00272 void set_enabled(bool enabled, bool registerchange=true,bool force_setting=false);
00273 bool is_enabled();
00274 
00275 
00276 
00277 // script action called when this visible object is clicked
00278 virtual bool action_on_click(void);
00279 virtual bool action_on_doubleclick(void);
00280 virtual bool action_on_close(void);
00281 virtual bool action_on_open(void);
00282 virtual bool action_on_getfocus(void);
00283 virtual bool action_on_loosefocus(void);
00284 virtual bool action_on_key(void);
00285  bool in_tabvisible(void) const;
00286 void set_buddylabel(long int labelid,bool registerchange=true,bool force_setting=false);
00287 long int buddylabel(void) const;
00288 void set_movebuddylabel(bool);
00289 bool move_buddylabel(void) const;
00290 
00291 
00292 int tag_number(const hk_string&);
00293 virtual hk_string tag_value(int tagnumber, bool& ok);
00294 virtual hk_string column_value(const hk_string& colname,bool& ok);
00295 hk_string tag_value(const hk_string&, bool& ok);
00296 int register_tag(const hk_string&);
00297 
00298     protected:
00299         virtual void        widget_specific_form_resizes(void);
00300         virtual void        widget_specific_font_changed(void);
00301         virtual void        widget_specific_label_changed(void);
00302         virtual void        widget_specific_foregroundcolour_changed(const hk_colour& oldcolour);
00303         virtual void        widget_specific_backgroundcolour_changed(const hk_colour& oldcolour);
00304         virtual bool        widget_specific_coordinates(unsigned int px,unsigned int py,unsigned int pwidth,unsigned int pheight);
00305         virtual void        widget_specific_raise_widget(void);
00306         virtual void        widget_specific_lower_widget(void);
00307         virtual void        widget_specific_tooltip_changed(void);
00308         virtual void        widget_specific_enabled_changed(void);
00309         virtual bool    presentationmode_changed(void);
00310         virtual void widget_specific_alignment(void);
00311         virtual void sizetype_changed(void);
00312         virtual void        widget_specific_sizetype_changed(void);
00313 
00314         bool        allow_datachanging(bool force_setting);
00315         enum enum_has_changed{standard,forcesetting};
00316         void        has_changed(bool registerchange,enum_has_changed force_setting=standard);
00317         hk_presentation*    p_presentation;
00318         enum_visibletype p_visibletype;
00319         bool        p_setcoordinates;
00320         bool        p_setwidgetcoordinates;
00321         bool        while_init;
00322         void set_tabvisible(hk_tabvisible*);
00323     private:
00324         static alignmenttype p_defaulttextalign;
00325         static alignmenttype p_defaultnumberalign;
00326         static  bool        p_open_maximized_windows;
00327 
00328         hk_visiblemodeprivate* p_designdata;
00329         hk_visiblemodeprivate* p_viewdata;
00330         hk_visibleprivate* p_private;
00331         long int    p_vupn;                       //visual unique presentation number
00332 
00333 };
00334 #endif

Generated on Thu Mar 9 18:40:41 2006 for hk_classes by  doxygen 1.4.1