Forms.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
#ifndef __CB2__FORMS_H__
00015
#define __CB2__FORMS_H__
00016
00017
00018
#include <cb2/utils.h>
00019
#include <cb2/Widgets.h>
00020
#include <cb2/Containers.h>
00021
00022
00023
namespace CB2 {
00024
00025
class FormElement;
00026
00027 class Form :
public Widget {
00028
public:
00029
Form(
Container & parent,
const String & css_class =
"",
const String & css_id =
"");
00030
Form(
Application & parent,
const String & css_class =
"",
const String & css_id =
"");
00031
00032
virtual ~Form();
00033
00034
virtual Template *
Add(
FormElement * child,
String & anchor);
00035
00036
private:
00037 typedef List< FormElement> element_list;
00038
00039 Template *
mtempl;
00040 element_list elements;
00041
00042
void init(
const String & css_class,
const String & css_id);
00043 };
00044
00045
00046 class FormElement :
public Class {
00047
public:
00048
FormElement(
Form & parent);
00049
virtual ~FormElement();
00050
00051
protected:
00052
void Data(
const String & data);
00053
00054
private:
00055
FormElement(
const FormElement & prev);
00056
void operator=(
const FormElement & prev);
00057
00058 Template *
ptempl;
00059 String panchor;
00060 bool filled;
00061 };
00062
00063
00064 class Button :
public FormElement {
00065
public:
00066
00067 typedef enum {
00068
button_submit,
00069
button_reset
00070 } button_type;
00071
00072
Button(
Form & parent,
const button_type & type,
const String & caption,
const String & name =
"",
const String & css_class =
"",
const String & css_id =
"");
00073
virtual ~Button();
00074
00075
private:
00076 button_type _type;
00077 String _caption;
00078 String _name;
00079 String _css_class;
00080 String _css_id;
00081 };
00082
00083
00084 class ListBox :
public FormElement {
00085
public:
00086
00087
ListBox(
Form & parent,
const String & name,
const MapList & options,
const String & selected =
"",
const String & css_class =
"",
const String & css_id =
"");
00088
virtual ~ListBox();
00089
00090
private:
00091 String _name;
00092 MapList _options;
00093 String _selected;
00094 String _css_class;
00095 String _css_id;
00096 };
00097
00098
00099 class InputBox :
public FormElement {
00100
public:
00101
InputBox(
Form & parent,
const String & name,
const String & value,
const String & css_class =
"",
const String & css_id =
"");
00102
virtual ~InputBox();
00103
00104
private:
00105 String _name;
00106 String _value;
00107 String _css_class;
00108 String _css_id;
00109 };
00110
00111 }
00112
00113
00114
#endif
Generated on Thu Sep 16 23:26:49 2004 for ColorBox2 by
1.3.7