GnuCashew ~ Web Application compatible with GnuCash sql data files.
GCW
Loading...
Searching...
No Matches
LayoutSaver.h
Go to the documentation of this file.
1#line 2 "src/Glb/LayoutSaver.h"
2
3#ifndef __LAYOUTSAVER_H___
4#define __LAYOUTSAVER_H___
5
6namespace GCW {
7
8#ifdef SECONDS_PER_YEAR
9#define _SPYR_ (SECONDS_PER_YEAR)
10#else
11#define _SPYR_ (1 * 60 * 60 * 24 * 365)
12#endif
13
14/*
15** Use this widget as a 'wrapper' for widgets to capture
16** changes to the layout size changes, so we can record
17** the width of the layout.
18**
19*/
20template <class C>
22: public C
23{
24 public:
25
26 LayoutSaver( const std::string name )
27 : C(),
28 m_name( name )
29 {
30 C::setLayoutSizeAware( true );
31 }
32
33 void layoutSizeChanged( int width, int height )
34 {
35 wApp-> setCookie( m_name + "_width", Wtx::itos( width ), _SPYR_ );
36 wApp-> setCookie( m_name + "_height", Wtx::itos( height ), _SPYR_ );
37 }
38
39 std::string m_name;
40
41}; // endclass LayoutSaver
42
43} // endnamespace GCW
44
45#endif
46
47
#define _SPYR_
Definition LayoutSaver.h:11
void layoutSizeChanged(int width, int height)
Definition LayoutSaver.h:33
std::string m_name
Definition LayoutSaver.h:39
LayoutSaver(const std::string name)
Definition LayoutSaver.h:26
Definition App.h:18