Mercurial > projects > dynamin
annotate dynamin/gui/folder_dialog.d @ 55:c138461bf845
Add focusing and other changes that are related
like descendantAdded/Removed events, Window.activated event, and updating List.
Window.state was also added, even though focusing does not depend on it.
author | Jordan Miner <jminer7@gmail.com> |
---|---|
date | Sat, 08 Aug 2009 15:42:27 -0500 |
parents | 127b9d99c01c |
children | 73060bc3f004 |
rev | line source |
---|---|
0 | 1 // Written in the D programming language |
2 // www.digitalmars.com/d/ | |
3 | |
4 /* | |
5 * The contents of this file are subject to the Mozilla Public License Version | |
6 * 1.1 (the "License"); you may not use this file except in compliance with | |
7 * the License. You may obtain a copy of the License at | |
8 * http://www.mozilla.org/MPL/ | |
9 * | |
10 * Software distributed under the License is distributed on an "AS IS" basis, | |
11 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License | |
12 * for the specific language governing rights and limitations under the | |
13 * License. | |
14 * | |
15 * The Original Code is the Dynamin library. | |
16 * | |
17 * The Initial Developer of the Original Code is Jordan Miner. | |
18 * Portions created by the Initial Developer are Copyright (C) 2006-2009 | |
19 * the Initial Developer. All Rights Reserved. | |
20 * | |
21 * Contributor(s): | |
22 * Jordan Miner <jminer7@gmail.com> | |
23 * | |
24 */ | |
25 | |
45
4eebc294a3ac
Rename DirectoryDialog to FolderDialog.
Jordan Miner <jminer7@gmail.com>
parents:
18
diff
changeset
|
26 module dynamin.gui.folder_dialog; |
0 | 27 |
28 import dynamin.all_core; | |
18
836a064828e8
Implement FileDialog/DirectoryDialog with GTK
Jordan Miner <jminer7@gmail.com>
parents:
5
diff
changeset
|
29 import dynamin.gui_backend; |
0 | 30 |
31 /** | |
32 * | |
33 * | |
46
127b9d99c01c
Rename uses of 'directory' to 'folder' in method names and comments.
Jordan Miner <jminer7@gmail.com>
parents:
45
diff
changeset
|
34 * The appearance of a folder dialog with Windows Classic: |
0 | 35 * |
46
127b9d99c01c
Rename uses of 'directory' to 'folder' in method names and comments.
Jordan Miner <jminer7@gmail.com>
parents:
45
diff
changeset
|
36 * $(IMAGE ../web/example_folder_dialog.png) |
0 | 37 */ |
45
4eebc294a3ac
Rename DirectoryDialog to FolderDialog.
Jordan Miner <jminer7@gmail.com>
parents:
18
diff
changeset
|
38 class FolderDialog { |
0 | 39 private: |
45
4eebc294a3ac
Rename DirectoryDialog to FolderDialog.
Jordan Miner <jminer7@gmail.com>
parents:
18
diff
changeset
|
40 mixin FolderDialogBackend; |
18
836a064828e8
Implement FileDialog/DirectoryDialog with GTK
Jordan Miner <jminer7@gmail.com>
parents:
5
diff
changeset
|
41 string _text; |
46
127b9d99c01c
Rename uses of 'directory' to 'folder' in method names and comments.
Jordan Miner <jminer7@gmail.com>
parents:
45
diff
changeset
|
42 string _folder; |
0 | 43 public: |
18
836a064828e8
Implement FileDialog/DirectoryDialog with GTK
Jordan Miner <jminer7@gmail.com>
parents:
5
diff
changeset
|
44 /// Gets or sets the text that is displayed in the dialog's title bar. |
836a064828e8
Implement FileDialog/DirectoryDialog with GTK
Jordan Miner <jminer7@gmail.com>
parents:
5
diff
changeset
|
45 string text() { return _text; } |
836a064828e8
Implement FileDialog/DirectoryDialog with GTK
Jordan Miner <jminer7@gmail.com>
parents:
5
diff
changeset
|
46 /// ditto |
836a064828e8
Implement FileDialog/DirectoryDialog with GTK
Jordan Miner <jminer7@gmail.com>
parents:
5
diff
changeset
|
47 void text(string str) { _text = str; } |
836a064828e8
Implement FileDialog/DirectoryDialog with GTK
Jordan Miner <jminer7@gmail.com>
parents:
5
diff
changeset
|
48 |
46
127b9d99c01c
Rename uses of 'directory' to 'folder' in method names and comments.
Jordan Miner <jminer7@gmail.com>
parents:
45
diff
changeset
|
49 /// Gets or sets the selected folder. |
127b9d99c01c
Rename uses of 'directory' to 'folder' in method names and comments.
Jordan Miner <jminer7@gmail.com>
parents:
45
diff
changeset
|
50 string folder() { |
127b9d99c01c
Rename uses of 'directory' to 'folder' in method names and comments.
Jordan Miner <jminer7@gmail.com>
parents:
45
diff
changeset
|
51 return _folder; |
0 | 52 } |
18
836a064828e8
Implement FileDialog/DirectoryDialog with GTK
Jordan Miner <jminer7@gmail.com>
parents:
5
diff
changeset
|
53 /// ditto |
46
127b9d99c01c
Rename uses of 'directory' to 'folder' in method names and comments.
Jordan Miner <jminer7@gmail.com>
parents:
45
diff
changeset
|
54 void folder(string str) { |
127b9d99c01c
Rename uses of 'directory' to 'folder' in method names and comments.
Jordan Miner <jminer7@gmail.com>
parents:
45
diff
changeset
|
55 _folder = str; |
0 | 56 } |
5
4029d5af7542
Add blank lines and rewrap some comments.
Jordan Miner <jminer7@gmail.com>
parents:
0
diff
changeset
|
57 |
0 | 58 DialogResult showDialog() { |
18
836a064828e8
Implement FileDialog/DirectoryDialog with GTK
Jordan Miner <jminer7@gmail.com>
parents:
5
diff
changeset
|
59 return backend_showDialog(); |
0 | 60 } |
61 } |