kjk / moriarty-sm

This URL has Read+Write access

moriarty-sm / JokesMainDialog.h
100644 45 lines (28 sloc) 1.023 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#ifndef JOKES_MAIN_DIALOG_H__
#define JOKES_MAIN_DIALOG_H__
 
#include "ModuleDialog.h"
#include <WindowsCE/Controls.hpp>
#include <WindowsCE/WinTextRenderer.hpp>
 
class JokesMainDialog: public ModuleDialog {
    
    TextRenderer renderer_;
    ListView list_;
 
    JokesMainDialog();
    ~JokesMainDialog();
    
    enum DisplayMode {
        showJoke,
        showList
    } displayMode_;
    
    void setDisplayMode(DisplayMode dm);
    
    void createListColumns();
    void createListItems();
    void resyncViewMenu();
 
protected:
 
    bool handleInitDialog(HWND fw, long ip);
   
    long handleResize(UINT st, ushort w, ushort h);
   
    long handleCommand(ushort nc, ushort id, HWND sender);
     
    bool handleLookupFinished(Event& event, const LookupFinishedEventData* data);
    
    long handleListItemActivate(int controlId, const NMLISTVIEW& header);
    
public:
    
    MODULE_DIALOG_CREATE_DECLARE(JokesMainDialog);
 
};
 
#endif // JOKES_MAIN_DIALOG_H__