46 #ifndef __WTX_DBO_TABLEVIEWMANAGER_H_234e0174_6b7d_11e8_b503_fb1ef3651ec0__ 47 #define __WTX_DBO_TABLEVIEWMANAGER_H_234e0174_6b7d_11e8_b503_fb1ef3651ec0__ 49 #include "TableView.h" 63 template <
class C,
class D>
65 :
public Wt::WContainerWidget
71 :
public Wt::WContainerWidget
77 void setFilter(
const Wt::WString & value );
78 void setSearch(
const Wt::WString & value );
80 void setToolTip(
const Wt::WString & value );
82 Wt::WHBoxLayout * lw()
const {
return m_lw; }
84 Wt::WHBoxLayout * m_lw =
nullptr;
85 Wt::WLineEdit * m_filter =
nullptr;
90 :
public Wt::WContainerWidget
96 void setRowCount(
int query,
int total );
97 void setQueryRowCount(
int value );
98 void setTotalRowCount(
int value );
102 void updateWidgets();
104 int m_queryRowCount = 0;
105 int m_totalRowCount = 0;
107 Wt::WText * m_rowCounts =
nullptr;
108 Wt::WText * m_center =
nullptr;
109 Wt::WText * m_right =
nullptr;
113 :
public Wt::WContainerWidget
119 void setRow(
int row,
int rowCount );
122 Wt::WPushButton * m_top ;
123 Wt::WPushButton * m_prev ;
124 Wt::WPushButton * m_next ;
125 Wt::WPushButton * m_bottom ;
135 const std::string & filter()
const;
137 Wt::WVBoxLayout * lw()
const {
return m_lw; }
138 SearchWidget * searchWidget()
const {
return m_searchWidget; }
143 Wt::WContainerWidget * toolBar();
144 Wt::WContainerWidget * buttonBar();
150 Wt::Signal< typename C::Ptr > &
addClicked() {
return m_addClicked ; }
151 Wt::Signal< typename C::Ptr > & deleteClicked() {
return m_deleteClicked ; }
152 Wt::Signal< typename C::Ptr > & itemClicked() {
return m_itemClicked ; }
153 Wt::Signal< typename C::Ptr > & doubleClicked() {
return m_doubleClicked ; }
154 Wt::Signal< typename C::Ptr > & editClicked() {
return m_editClicked ; }
155 Wt::Signal< typename C::Ptr > & itemSaved() {
return m_itemSaved ; }
156 Wt::Signal< std::string > & exportClicked() {
return m_exportClicked ; }
157 Wt::Signal< std::string > & printClicked() {
return m_printClicked ; }
158 Wt::Signal< std::string > & additionalClicked() {
return m_additionalClicked ; }
160 std::unique_ptr<D> makeDetail(
typename C::Ptr item );
161 D * openDetail( Wt::WModelIndex index );
162 D * openDetail(
typename C::Ptr item );
164 bool doSave( D * detail );
165 void doClose( D * detail );
167 void setReadOnly(
bool value );
169 Wt::WTemplate * buttonTemplt() {
return m_buttonTemplt; }
171 bool m_openDetail =
true;
173 Wt::WPushButton * m_pbAdd =
nullptr;
174 Wt::WPushButton * m_pbEdit =
nullptr;
175 Wt::WPushButton * m_pbDelete =
nullptr;
176 Wt::WPushButton * m_pbPrint =
nullptr;
177 Wt::WPushButton * m_pbExport =
nullptr;
179 void setDialogSize( Wt::WLength width, Wt::WLength height );
186 void on_clicked( Wt::WModelIndex index, Wt::WMouseEvent event );
187 void on_doubleClicked( Wt::WModelIndex index, Wt::WMouseEvent event );
188 void on_keyPressed( Wt::WKeyEvent keyEvent );
189 void on_keyWentDown( Wt::WKeyEvent keyEvent );
190 void on_filterEntered();
191 void on_filterTyped();
192 void on_add_clicked();
193 void on_edit_clicked();
194 void do_on_delete_clicked() { on_delete_clicked(
false); }
195 void on_delete_clicked(
bool noask );
196 void on_export_clicked();
197 void on_print_clicked();
198 void on_additional_clicked();
199 void on_unlock_clicked();
204 Wt::WTemplate * m_buttonTemplt = nullptr ;
206 Wt::WVBoxLayout * m_lw = nullptr ;
208 SearchWidget * m_searchWidget = nullptr ;
209 FooterWidget * m_footerWidget = nullptr ;
210 PrevNextWidget * m_prevNextWidget = nullptr ;
211 Wt::WContainerWidget * m_toolBar = nullptr ;
212 Wt::WContainerWidget * m_buttonBar = nullptr ;
213 Wt::Signal< typename C::Ptr > m_itemClicked ;
214 Wt::Signal< typename C::Ptr > m_addClicked ;
215 Wt::Signal< typename C::Ptr > m_deleteClicked ;
216 Wt::Signal< typename C::Ptr > m_doubleClicked ;
217 Wt::Signal< typename C::Ptr > m_editClicked ;
218 Wt::Signal< typename C::Ptr > m_itemSaved ;
219 Wt::Signal< std::string > m_exportClicked ;
220 Wt::Signal< std::string > m_printClicked ;
221 Wt::Signal< std::string > m_additionalClicked ;
223 bool m_readOnly =
false;
230 #include "TableViewManager_imp.h" 232 #endif // __WTX_DBO_TABLEVIEWMANAGER_H___
Wt::WLength g_dialogWidth
Default Dialog Width.
Wt::WLength g_dialogHeight
Default Dialog Height.
Wt::Signal< typename C::Ptr > & addClicked()
Add.