My favorites | Sign in
Project Home Downloads Issues Source
Checkout   Browse   Changes    
 
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
#ifndef _GREENPAD_OPENSAVEDLG_H_
#define _GREENPAD_OPENSAVEDLG_H_
#include "kilib/ktlarray.h"
#include "kilib/ktlaptr.h"
#include "kilib/string.h"
#include "rsrc/resource.h"



//========================================================================
//@{ @pkg Gp.Dlg //@}
//@{
// —˜—p‰Â”\•¶ŽšƒR[ƒhƒŠƒXƒg
//@}
//========================================================================

class CharSetList
{
public:

struct CsInfo
{
int ID;
const TCHAR* longName;
const TCHAR* shortName;
int type;
};

public:

CharSetList();
const CsInfo& operator[](size_t i) const { return list_[i]; }
ulong size() const { return list_.size(); }
int defaultCs() const;
ulong defaultCsi() const;
ulong findCsi( int cs ) const;

private:

enum { SAVE=1, LOAD=2, BOTH=3 };
ki::storage<CsInfo> list_;
};



//========================================================================
//@{
// uƒtƒ@ƒCƒ‹‚ðŠJ‚­vƒ_ƒCƒAƒƒO
//
// Windows‹¤’ʂ̃_ƒCƒAƒƒO‚̉º‚ɁA•¶ŽšƒR[ƒh‚Ì‘I‘ð—“‚ð
// •t‚¯‰Á‚¦‚½‚à‚Ì‚ð•\ަ‚·‚éB
//@}
//========================================================================

class OpenFileDlg
{
public:
explicit OpenFileDlg( const CharSetList& csl );
bool DoModal( HWND wnd, const TCHAR* filter, const TCHAR* fnm );

public:
const TCHAR* filename() const;
int csi() const;

public:
static ki::aarr<TCHAR> ConnectWithNull( ki::String lst[], int num );

private:
const CharSetList& csl_;
TCHAR filename_[MAX_PATH];
int csIndex_;

private:
static OpenFileDlg* pThis; // ƒ}ƒ‹ƒ`ƒXƒŒƒbƒh‹ÖŽ~I
static UINT_PTR CALLBACK OfnHook( HWND, UINT, WPARAM, LPARAM );
};



//------------------------------------------------------------------------
#ifndef __ccdoc__

inline OpenFileDlg::OpenFileDlg( const CharSetList& csl )
: csl_(csl) {}

inline const TCHAR* OpenFileDlg::filename() const
{ return filename_; }

inline int OpenFileDlg::csi() const
{ return csIndex_; }



#endif // __ccdoc__
//========================================================================
//@{
// uƒtƒ@ƒCƒ‹‚ð•Û‘¶vƒ_ƒCƒAƒƒO
//
// Windows‹¤’ʂ̃_ƒCƒAƒƒO‚̉º‚ɁA•¶ŽšƒR[ƒh‚Ì‘I‘ð—“‚Æ
// ‰üsƒR[ƒh‚Ì‘I‘ð—“‚ð•t‚¯‰Á‚¦‚½‚à‚Ì‚ð•\ަ‚·‚éB
//@}
//========================================================================

class SaveFileDlg
{
public:
explicit SaveFileDlg( const CharSetList& csl, int cs, int lb );
bool DoModal( HWND wnd, const TCHAR* filter, const TCHAR* fnm );

public:
const TCHAR* filename() const;
int csi() const;
int lb() const;

public:
static ki::aarr<TCHAR> ConnectWithNull( ki::String lst[], int num );

private:
const CharSetList& csl_;
TCHAR filename_[MAX_PATH];
int csIndex_;
int lb_;

private:
static SaveFileDlg* pThis; // ƒ}ƒ‹ƒ`ƒXƒŒƒbƒh‹ÖŽ~I
static UINT_PTR CALLBACK OfnHook( HWND, UINT, WPARAM, LPARAM );
};

//------------------------------------------------------------------------
#ifndef __ccdoc__

inline SaveFileDlg::SaveFileDlg( const CharSetList& csl, int cs, int lb )
: csl_(csl), csIndex_(cs), lb_(lb) {}

inline const TCHAR* SaveFileDlg::filename() const
{ return filename_; }

inline int SaveFileDlg::csi() const
{ return csIndex_; }

inline int SaveFileDlg::lb() const
{ return lb_; }

inline ki::aarr<TCHAR> SaveFileDlg::ConnectWithNull
( ki::String lst[], int num )
{ return OpenFileDlg::ConnectWithNull( lst, num ); }



#endif // __ccdoc__
//========================================================================
//@{
// uŠJ‚«’¼‚·vƒ_ƒCƒAƒƒO
//
// •¶ŽšƒR[ƒh‘I‘ð—“•\ަ
//@}
//========================================================================

class ReopenDlg : public ki::DlgImpl
{
public:
ReopenDlg( const CharSetList& csl, int csi );
int csi() const;

private:
void on_init();
bool on_ok();

private:
const CharSetList& csl_;
int csIndex_;
};

//------------------------------------------------------------------------
#ifndef __ccdoc__

inline int ReopenDlg::csi() const
{ return csIndex_; }



//========================================================================

#endif // __ccdoc__
#endif // _GREENPAD_OPENSAVEDLG_H_

Change log

r89 by roytam on Apr 29, 2010   Diff
- [GreenPad] import GreenPad with NT 3.51
fix.
Go to: 
Project members, sign in to write a code review

Older revisions

All revisions of this file

File info

Size: 4041 bytes, 185 lines

File properties

svn:mime-type
text/plain; charset=shift_jis
svn:eol-style
native
Powered by Google Project Hosting