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

hk_visible.h

00001 // ****************************************************************************
00002 // copyright (c) 2000-2004 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 
00018 using namespace std;
00019 
00020 class hk_presentation;
00021 class hk_form;
00022 class hk_report;
00023 class hk_visiblemodeprivate;
00024 class hk_visibleprivate;
00025 
00034 class hk_visible:public hk_class
00035 
00036 {
00037     friend class hk_presentation;
00038     friend class hk_form;
00039     friend class hk_reportdata;
00040     public:
00041         hk_visible(hk_presentation* p=NULL);
00042         virtual     ~hk_visible(void);
00046         void        set_x(unsigned int px, bool registerchange=true);
00050         void        set_y(unsigned int py, bool registerchange=true);
00054         void        set_width(unsigned int w, bool registerchange=true);
00058         void        set_height(unsigned int h, bool registerchange=true);
00059         unsigned int    x(void) const;
00060         unsigned int    y(void) const;
00061         unsigned int    width(void)const;
00062         unsigned int    height(void) const;
00066         void        set_size(unsigned int x, unsigned int y,unsigned int w, unsigned int h, bool registerchange=true);
00067         void        set_size(unsigned int x, unsigned int y,unsigned int w, unsigned int h, bool registerchange,bool force_setting);
00068         void        set_size(unsigned int width, unsigned int height, bool registerchange=true);
00069         void        set_position(unsigned int x, unsigned int y, bool registerchange=true);
00074         void        set_label(const hk_string& l, bool registerchange=true);
00075         void        set_label(const hk_string& l, bool registerchange,bool force_setting);
00076         hk_string       label(void);
00081         bool set_identifier(const hk_string&,bool registerchange=true,enum_interaction=interactive);
00082         hk_string identifier(void) const;
00083 
00084 
00085         enum enum_visibletype {textlabel,button,rowselector,boolean,lineedit,memo,combobox,grid,form,report,reportsection,reportdata,query,subform,other};
00086         enum_visibletype  type(void) {return p_visibletype;}
00090         void       set_font(const hk_string& font,int size,bool registerchange=true);
00091         void       set_font(const hk_string& font,int size,bool registerchange,bool force_setting);
00092         void       set_font(const hk_font& font,bool registerchange=false);
00093         void       set_font(const hk_font& font,bool registerchange,bool force_setting);
00094 
00095         virtual hk_font     font(void);
00099         void   set_foregroundcolour(const hk_colour& colour,bool registerchange=true);
00100         void   set_foregroundcolour(const hk_colour& colour,bool registerchange,bool force_setting);
00101         hk_colour foregroundcolour(void);
00105         void   set_backgroundcolour(const hk_colour& colour,bool registerchange=true);
00106         void   set_backgroundcolour(const hk_colour& colour,bool registerchange,bool force_setting);
00107         hk_colour backgroundcolour(void);
00108 
00114         void set_neverregisterchange(bool n);
00115         void set_neverregisterchange(bool n,bool force_setting);
00116         bool neverregisterchange(void);
00117         virtual void savedata(ostream& s );
00118         virtual void loaddata(const hk_string& definition);
00122         long  presentationnumber(void) const;
00123         void set_datetimeformat(const hk_string& datetime,const hk_string& date, const hk_string&  time);
00124         void set_datetimeformat(const hk_string& datetime,const hk_string& date, const hk_string&  time,bool force_setting);
00125         hk_string datetimeformat(void);
00126         hk_string dateformat(void);
00127         hk_string timeformat(void);
00128         void set_counts_as(unsigned long int c);
00129         virtual void set_counts_as(unsigned long int c,bool force_setting);
00130         virtual unsigned long int counts_as(void);
00131         virtual hk_string replace(const hk_string& where);
00132         hk_presentation* presentation(void);
00133 
00138         void set_load_presentationnumber(bool l);
00139         void set_load_presentationnumber(bool l,bool force_setting);
00140         bool load_presentationnumber(void);
00144         enum alignmenttype{alignleft,alignright,aligncenter,aligndefault};
00148         void set_alignment(alignmenttype a,bool registerchange=true);
00149         void set_alignment(alignmenttype a,bool registerchange,bool force_setting);
00150         alignmenttype alignment(void);
00151 
00156         static void set_defaulttextalignment(alignmenttype a);
00157         static alignmenttype defaulttextalignment(void);
00162         static void set_defaultnumberalignment(alignmenttype a);
00163         static alignmenttype defaultnumberalignment(void);
00167         static void set_open_maximized_windows(bool m);
00168         static bool open_maximized_windows(void);
00169 
00173         virtual void lower_widget(bool registerchange=true);
00177         virtual void raise_widget(bool registerchange=true);
00178 
00182         void set_on_click_action(const hk_string&,bool registerchange=true);
00186         hk_string on_click_action(void);
00190         void set_on_doubleclick_action(const hk_string&,bool registerchange=true);
00194         hk_string on_doubleclick_action(void);
00200         void set_on_open_action(const hk_string&,bool registerchange=true);
00204         hk_string on_open_action(void);
00209         void set_on_close_action(const hk_string&,bool registerchange=true);
00213         hk_string on_close_action(void);
00214 
00215 
00216     protected:
00217         virtual void        widget_specific_form_resizes(void);
00218         virtual void        widget_specific_font_changed(void);
00219         virtual void        widget_specific_label_changed(void);
00220         virtual void        widget_specific_foregroundcolour_changed(const hk_colour& oldcolour);
00221         virtual void        widget_specific_backgroundcolour_changed(const hk_colour& oldcolour);
00222         virtual bool        widget_specific_coordinates(unsigned int px,unsigned int py,unsigned int pwidth,unsigned int pheight);
00223         virtual void        widget_specific_raise_widget(void);
00224         virtual void        widget_specific_lower_widget(void);
00225         virtual void    presentationmode_changed(void);
00226         virtual void widget_specific_alignment(void);
00227         virtual void sizetype_changed(void);
00228         virtual void        widget_specific_sizetype_changed(void);
00229 // script action called when this visible object is clicked
00230 virtual bool action_on_click(void);
00231 virtual bool action_on_doubleclick(void);
00232 virtual     bool  action_on_close(void);
00233 virtual     bool  action_on_open(void);
00234 
00235         bool        allow_datachanging(bool force_setting);
00236         enum enum_has_changed{standard,forcesetting};
00237         void        has_changed(bool registerchange,enum_has_changed force_setting=standard);
00238         hk_presentation*    p_presentation;
00239         enum_visibletype p_visibletype;
00240         bool        p_setcoordinates;
00241         bool        p_setwidgetcoordinates;
00242         bool        while_init;
00243 
00244     private:
00245         static alignmenttype p_defaulttextalign;
00246         static alignmenttype p_defaultnumberalign;
00247         static  bool        p_open_maximized_windows;
00248 
00249         hk_visiblemodeprivate* p_designdata;
00250         hk_visiblemodeprivate* p_viewdata;
00251         hk_visibleprivate* p_private;
00252         long int    p_vupn;                       //visual unique presentation number
00253 
00254 };
00255 #endif

Generated on Tue Mar 22 19:28:08 2005 for Databaseconnectionclasses by  doxygen 1.4.1