Subversion Repositories AndroidProjects

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
244 chris 1
#ifndef __V12DEMOAPP_H__
2
#define __V12DEMOAPP_H__
3
 
4
#include "..\SexyAppFramework\SexyAppBase.h"
5
 
6
namespace Sexy
7
{
8
 
9
class Board;
10
 
11
class V12DemoApp : public SexyAppBase
12
{
13
 
14
public:
15
 
16
        Board*                                  mBoard;
17
 
18
public:
19
 
20
        V12DemoApp();
21
        virtual ~V12DemoApp();
22
 
23
        //////////////////////////////////////////////////////////////////////////
24
        //      Function: ShutdownHook
25
        //      Purpose: Instead of overriding Shutdown() and having to remember to
26
        //      call ::Shutdown(), and to remember to check if mShutdown is true
27
        //      or not, you can use this and forget about those previous headaches.
28
        //      Guaranteed to not be called once mShutdown is true so no need to worry
29
        //      about it occurring multiple times (unless of course for some reason you
30
        //      manually call it more than once). Thus, you no longer need a ShutdownHook()
31
        //      override.
32
        //////////////////////////////////////////////////////////////////////////      
33
        virtual void    ShutdownHook();
34
 
35
        //////////////////////////////////////////////////////////////////////////
36
        //      Function: InitHook
37
        //      Purpose: This uses the same idea behind ShutdownHook in that you don't
38
        //      have to worry about calling the base class' Init method anymore
39
        //      and can forget about those previous hassels. This method is guaranteed
40
        //      to be called only once, right after SexyAppBase::Init finishes. Thus,
41
        //      you no longer need an Init() override.
42
        //////////////////////////////////////////////////////////////////////////      
43
        virtual void    InitHook();
44
 
45
        //////////////////////////////////////////////////////////////////////////
46
        //      With these 2 functions, we'll pause the board if focus shifts to another
47
        //      application.
48
        //////////////////////////////////////////////////////////////////////////      
49
        virtual void    LostFocus();
50
        virtual void    GotFocus();
51
 
52
        //////////////////////////////////////////////////////////////////////////
53
        //      Function: DialogButtonDepress
54
        //      Parameters:
55
        //              dialog_id       - The ID of the dialog box whose button is emitting
56
        //                                              the DialogButtonDepress signal.
57
        //              button_id       - The ID of the button in the above dialog box that
58
        //                                              has been depressed.
59
        //
60
        //      Purpose: Previously, dialog button (de)presses were all routed through
61
        //      a ButtonListener. This was annoying, as to check which button was
62
        //      pressed, you had to check if the ID of the button was the ID of the
63
        //      dialog box + 2000 or + 3000. It also had the tendency to create large
64
        //      Button(De)press functions with giant case statements. With this new
65
        //      implementation, button (de)presses from a dialog box will be passed
66
        //      into this alternative method, and the IDs are their simple, original
67
        //      IDs that you assigned to the widgets upon initialization. For dialog
68
        //      boxes with a single button, the button's ID is 1, and for dialogs with
69
        //      2 buttons, it's 1 for yes/ok and 0 for no/cancel. Of course, this is 
70
        //      fully backwards compatible, so if you don't want to custom override
71
        //      the DialogButton(De)press method(s) you don't have to, and can still 
72
        //      check which button was pressed using the old original method via the
73
        //      Button(De)press methods.
74
        //////////////////////////////////////////////////////////////////////////      
75
        virtual void    DialogButtonDepress(int dialog_id, int button_id);
76
};
77
 
78
}
79
#endif //__V12DEMOAPP_H__