Changeset 16
- Timestamp:
- 12/04/06 09:33:21 (2 years ago)
- Files:
-
- trunk/minwin/docs/builddocs.bat (modified) (2 diffs)
- trunk/minwin/docs/minwin.css (modified) (2 diffs)
- trunk/minwin/docs/minwin.ddoc (modified) (3 diffs)
- trunk/minwin/docs/minwin/dialog.d (modified) (1 diff)
- trunk/minwin/docs/minwin/event.d (modified) (1 diff)
- trunk/minwin/docs/minwin/group.d (added)
- trunk/minwin/docs/minwin/index.d (added)
- trunk/minwin/docs/minwin/layout.d (modified) (1 diff)
- trunk/minwin/docs/minwin/multidg.d (modified) (1 diff)
- trunk/minwin/docs/minwin/peerimpl.d (added)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/minwin/docs/builddocs.bat
r14 r16 5 5 dmd -D minwin.ddoc minwin/event.d -c -o- 6 6 dmd -D minwin.ddoc minwin/geometry.d -c -o- 7 dmd -D minwin.ddoc minwin/group.d -c -o- 7 8 dmd -D minwin.ddoc minwin/icon.d -c -o- 8 9 dmd -D minwin.ddoc minwin/image.d -c -o- … … 12 13 dmd -D minwin.ddoc minwin/paint.d -c -o- 13 14 dmd -D minwin.ddoc minwin/peer.d -c -o- 15 dmd -D minwin.ddoc minwin/peerimpl.d -c -o- 14 16 dmd -D minwin.ddoc minwin/window.d -c -o- 17 18 dmd -D minwin.ddoc minwin/index.d -c -o- 15 19 pause trunk/minwin/docs/minwin.css
r14 r16 1 /* MinWin documentation stylesheet 2 * 3 * Written by Tomas Lindquist Olsen and released to the public domain, as 4 * explained at http://creativecommons.org/licenses/publicdomain 5 * Report comments and bugs at dsource: http://www.dsource.org/projects/minwin 6 */ 7 8 html,body,h1,h2,h3,table,tr,td,dl,a,br,dd,dl,dt,big,u,div,span 9 { 10 border-style: none; 11 border-width: 0; 12 padding: 0; 13 margin: 0; 14 text-align: left; 15 vertical-align: top; 16 } 17 18 body 19 { 20 background-color: white; 21 } 22 23 dd 24 { 25 margin-left: 2em; 26 } 27 28 .title 29 { 30 padding: 0.25em; 31 } 32 33 .package 34 { 35 margin-bottom: 0.25em; 36 } 37 38 a.toc 39 { 40 margin-left: 0.5em; 41 } 42 1 43 #toc 2 44 { 3 45 vertical-align: top; 4 padding: 10px; 46 padding-left: 1em; 47 padding-right: 3em; 48 5 49 } 6 50 … … 8 52 { 9 53 vertical-align: top; 54 padding-left: 0; 55 padding-right: 2em; 10 56 } 57 58 dl.class 59 { 60 background-color: WhiteSmoke; 61 margin-bottom: 1em; 62 padding: 0.5em; 63 } 64 65 table.thinborder,td.thinborder 66 { 67 border-style: solid; 68 border-collapse: collapse; 69 border-width: 2px; 70 border-color: black; 71 } 72 trunk/minwin/docs/minwin.ddoc
r14 r16 1 $(DDOC_COMMENT 2 MinWin documentation macros 3 4 Written by Tomas Lindquist Olsen and released to the public domain, as 5 explained at http://creativecommons.org/licenses/publicdomain 6 Report comments and bugs at dsource: http://www.dsource.org/projects/minwin 7 ) 8 1 9 WIN = $(RED Windows) 2 10 MOTIF = $(GREEN Motif) 3 11 GTK = $(BLUE GTK) 12 13 PAGE_TITLE = <h1 class="title">$(TITLE)</h1> 4 14 5 15 DDOC = <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" … … 12 22 </head> 13 23 <body> 14 <h1>$(TITLE)</h1> 24 $(PAGE_TITLE) 15 25 <table> 16 26 <tr> … … 27 37 </html> 28 38 29 INDEX_LINK = $(LINK2 $0.html,$0) 39 INDEX_LINK = <a href="$0.html" class="toc">$0</a> 40 INDEX_PACKAGE = <h3 class="package">$0</h3> 30 41 31 INDEX = $(INDEX_LINK app) $(BR) 42 BR = <br /> 43 44 INDEX = $(INDEX_PACKAGE minwin) 45 $(INDEX_LINK app) $(BR) 32 46 $(INDEX_LINK button) $(BR) 33 47 $(INDEX_LINK component) $(BR) 34 48 $(INDEX_LINK dialog) $(BR) 35 49 $(INDEX_LINK event) $(BR) 50 $(INDEX_LINK geometry) $(BR) 51 $(INDEX_LINK group) $(BR) 36 52 $(INDEX_LINK icon) $(BR) 37 53 $(INDEX_LINK image) $(BR) 54 $(INDEX_LINK layout) $(BR) 38 55 $(INDEX_LINK menu) $(BR) 39 56 $(INDEX_LINK multidg) $(BR) 40 57 $(INDEX_LINK paint) $(BR) 41 58 $(INDEX_LINK peer) $(BR) 42 $(INDEX_LINK geometry) $(BR)59 $(INDEX_LINK peerimpl) $(BR) 43 60 $(INDEX_LINK window) $(BR) 61 62 CLASS_DL = <dl class="class">$0</dl> 63 64 DDOC_CLASS_MEMBERS = $(CLASS_DL $0) 65 66 BORDERLAYOUT_TABLE = <table> 67 <tr><td align="center" colspan="3" class="thinborder" >North</td></tr> 68 <tr><td class="thinborder" >West</td><td class="thinborder" >Center</td><td class="thinborder">East</td></tr> 69 <tr><td align="center" colspan="3" class="thinborder" >South</td></tr> 70 </table> 71 72 H1 = <h1>$0</h1> 73 H2 = <h2>$0</h2> 74 H3 = <h3>$0</h3> trunk/minwin/docs/minwin/dialog.d
r14 r16 3 3 import minwin.window; 4 4 5 /// A dialog box for modal interactions. 5 6 class Dialog : AbstractWindow 6 7 { 8 /** 9 Construct a dialog owned by the given window and having the specified modality. 10 If the dialog is modal setting the visibility to true will block execution until the dialog is closed. 11 */ 12 this(AbstractWindow owner, char[] title, bool modal = true, char[] name = ""); 13 14 /// Wrap a preconstucted peer as a MinWin Dialog. 15 this(WindowPeer peer); 16 17 /** 18 Override read/write property to implement modal dialogs. A modal dialog will block execution and events 19 to the other windows in the application until the dialog is closed by setting visible off or destroying the dialog. 20 */ 21 bool visible; 7 22 } 23 24 /// Structure for specifying a filter in a file dialog. 25 struct FileFilter 26 { 27 /// Textual description of the filter to show to user. 28 char[] description; 29 30 /// Array of extensions to filter (eg, txt). 31 char[][] extensions; 32 } 33 34 /// Structure for communicating with open/save file dialogs. 35 struct FileDialogData 36 { 37 /// Read/write property for the title of the dialog. 38 char[] title; 39 /// Writable property for the array of filters to display. 40 FileFilter[] filter; 41 /// Writable property for the initial directory to start in. 42 char[] initialDir; 43 /// Writable property for the initial file name. 44 char[] initialFile; 45 /// Readable property for the output file name. 46 char[] result; 47 /// Readable property for the output filter selected. 48 int filterIndex; 49 } 50 51 /// Display a dialog to choose a file. Returns true if the user closed the dialog with OK or Open. 52 bool openFileDialog(AbstractWindow owner, inout FileDialogData data); 53 /// Display a dialog to save a file. Returns true if the user closed the dialog with OK or Save. 54 bool saveFileDialog(AbstractWindow owner, inout FileDialogData data); 55 56 /// Show a modal information dialog with given text, title and owner. 57 void informationDialog(AbstractWindow owner, char[] text, char[] title); 58 /// Show a modal warning dialog with given text, title and owner. 59 void warningDialog(AbstractWindow owner, char[] text, char[] title); 60 /// Show a modal error dialog with given text, title and owner. 61 void errorDialog(AbstractWindow owner, char[] text, char[] title); 62 /// Show a modal message dialog with given text, title and owner. 63 void messageDialog(AbstractWindow owner, char[] text, char[] title); trunk/minwin/docs/minwin/event.d
r14 r16 1 1 module minwin.event; 2 2 3 import minwin.geometry; 4 5 /// Enumeration of modifier keys. Can be or'd together. 6 enum Modifier 7 { 8 /// The shift key was held down during the event. 9 Shift = 1, 10 /// The alt key was held down during the event. 11 Alt = 2, 12 /// The control key was held down during the event. 13 Ctrl = 4, 14 /// The command key was held down during the event (if supported). 15 Command = 8, 16 /// The meta key was held down during the event (if supported). 17 Meta = 16 18 } 19 20 /// Platform-specific generic event type (eg, MSG, XEvent, GdkEvent). 21 alias void* EventNative; 22 23 /// Struct wrapping the native generic event type. 3 24 struct Event 4 25 { 26 /// The native event. 27 EventNative native; 28 /// Read-only property for the platform-specific event type. 29 int id; 30 /// Read-only property for the keyboard modifiers held down during the event. 31 int modifiers; 5 32 } 6 33 34 /// Platform-specific generic key event type (eg, MSG, XKeyEvent, GdkKeyEvent). 35 alias void* KeyEventNative; 36 37 /// Struct wrapping the native key event type. 7 38 struct KeyEvent 8 39 { 40 /// The native key event. 41 KeyEventNative native; 42 /// Read-only property for the platform-specific event type. 43 int id; 44 /// Read-only property for the keyboard modifiers held down during the event. 45 int modifiers; 46 /// The character typed. 47 dchar keyChar; 9 48 } 49 /// Platform-specific id for key character press events. 50 alias uint KeyPressedEvent; 51 /// Platform-specific id for key down events. 52 alias uint KeyDownEvent; 53 /// Platform-specific id for key up events. 54 alias uint KeyUpEvent; 10 55 56 /// Platform-specific generic mouse event type (eg, MSG, XMouseEvent, GdkMouseEvent). 57 alias void* MouseEventNative; 58 59 /// Struct wrapping the native mouse event type. 11 60 struct MouseEvent 12 61 { 62 /// The native event 63 EventNative native; 64 /// Read-only property for the platform-specific event type. 65 int id; 66 /// Read-only property for the keyboard modifiers held down during the event. 67 int modifiers; 68 /// The location of the event in source component coordinates. 69 Point point; 13 70 } 71 /// Platform-specific id for mouse moved events. 72 alias uint MouseMovedEvent; 73 /// Platform-specific id for 1st mouse button down events. 74 alias uint MouseDownEvent; 75 /// Platform-specific id for 1st mouse button up events. 76 alias uint MouseUpEvent; 77 /// Platform-specific id for 2nd mouse button down events. 78 alias uint MouseAlt1DownEvent; 79 /// Platform-specific id for 2nd mouse button up events. 80 alias uint MouseAlt1UpEvent; 81 /// Platform-specific id for 3rd mouse button down events. 82 alias uint MouseAlt2DownEvent; 83 /// Platform-specific id for 3rd mouse button up events. 84 alias uint MouseAlt2UpEvent; 14 85 86 /// Platform-specific generic window event type (eg, MSG, XConfigureEvent, GdkEventConfigure). 87 alias void* WindowEventNative; 88 89 /// Struct wrapping the native window event type. 15 90 struct WindowEvent 16 91 { 92 /// The native event 93 WindowEventNative native; 94 /// Read-only property for the platform-specific event type. 95 int id; 96 /// Read-only property for the keyboard modifiers held down during the event. 97 int modifiers; 98 /// The location of the event in source component coordinates. 99 Point point; 17 100 } 101 /// Platform-specific id for window size events. 102 alias uint WindowSizeEvent; 103 /// Platform-specific id for window sizing events. 104 alias uint WindowSizingEvent; 105 /// Platform-specific id for window move events. 106 alias uint WindowMoveEvent; 107 /// Platform-specific id for window moving events. 108 alias uint WindowMovingEvent; 109 110 /** 111 Waits for the next event from the event queue. Blocks until event is available. 112 113 The event is removed from the queue. 114 115 Returns: false on quit event, true on all others. 116 */ 117 bool nextEvent(Event* event); 118 119 /** 120 Retrieves the next event from the event queue (if possible). Returns immediately. 121 122 The event is removed from the queue. 123 124 Returns: true is an event was available, false if not. 125 */ 126 bool peekEvent(Event* event); 127 128 /** 129 Passes event on to the backend for processing in the event loop. 130 */ 131 void dispatchEvent(Event* event); trunk/minwin/docs/minwin/layout.d
r14 r16 1 1 module minwin.layout; 2 2 3 class LayoutManager 3 import minwin.component; 4 import minwin.geometry; 5 6 /// Interface for positioning out children in a component. 7 interface LayoutManager 4 8 { 9 /// Position children of c. Can reuse cached information from previous preferredSize() or layout() calls. 10 void layout(Component c); 11 /// Compute preferred layout size. Does not reuse cached information. 12 Point preferredSize(Component c); 13 /// Clear cache if present. 14 void reset(); 5 15 } 16 17 /// Enumeration of possible layout directions. 18 enum Dir 19 { 20 /// Flow left to right, then right to left. 21 Horizontal, 22 /// Flow top to bottom, then bottom to top. 23 Vertical 24 } 25 26 /// A layout manager that positiions children in a row vertically or horizontally. 27 /// The "flow" refers to the direction along which the children are being positioned and "side" refers to the orthogonal direction. 28 class FlowLayout : LayoutManager 29 { 30 /// Read/write property for the orientation and direction of the flow. 31 Dir dir; 32 ///Read/write property for the gap in pixels between children. 33 int flowGap; 34 /// Read/write property for the gap in pixels around the sides of the children. 35 int sideGap; 36 /// If true stretch the children sides to be the same size. 37 bool sideStretch; 38 /// Read/write property for the number of items to position before flipping to the other side of the component and reversing direction. 39 int flowReverse; 40 /// Gap at the ends of the layout. If the value is greater than one it is in absolute pixels. If the value is less than one it is the percentage of extra space between the actual size and the preferred size. 41 double endGap; 42 /// Construct a FlowLayout in the requested direction. 43 this(Dir dir = Dir.Vertical); 44 /// Position children in a row in the specified direction possibly flipping sides to position from the other side of the component. 45 void layout(Component c); 46 /// Compute preferred layout size and caches result. 47 Point preferredSize(Component c); 48 /// Clear the preferred size cache. 49 void reset(); 50 } 51 52 /// A layout manager that positiions children in a grid. 53 class TableLayout : LayoutManager 54 { 55 /// Read/write property for the spacing of the columns. 56 double[] colScales; 57 /// Read/write property for the spacing of the rows. 58 double[] rowScales; 59 /// Construct a TableLayout with extra width distributed among the columns according to colScales and the extra height among the rows according to rowScales. The scale values must be between 0 and 1 and must total 1. The gap is the space in pixels to leave between children. 60 this(double[] colScales, double[] rowScales, int gap = 0); 61 /// Position children in the grid starting from the upper left and moving initially along the first row. 62 void layout(Component c); 63 /// Compute preferred layout size and caches result. 64 Point preferredSize(Component c); 65 /// Clear the cache of preferred size. 66 void reset(); 67 } 68 69 /// Enumeration for the location of a child in a BorderLayout. 70 enum Loc 71 { 72 /// 73 North, 74 /// 75 South, 76 /// 77 East, 78 /// 79 West, 80 /// 81 Center 82 } 83 84 /** 85 A layout manager that positiions children like Java's BorderLayout 86 87 $(BORDERLAYOUT_TABLE) 88 */ 89 class BorderLayout : LayoutManager 90 { 91 /// Read/write property of the locations of children to position. 92 Component[Loc.max+1] location; 93 /// Position children according to their locations. If a child is not in the location array it is not positioned. 94 void layout(Component c); 95 /// Compute preferred layout size. 96 Point preferredSize(Component c); 97 /// Clear the cache if any. 98 void reset(); 99 } trunk/minwin/docs/minwin/multidg.d
r14 r16 1 1 module minwin.multidg; 2 2 3 /** 4 Store multiple delegates with any number of arguments. 5 */ 3 6 struct MultiDelegate(T...) 4 7 { 8 /// Alias for delegate type. 9 alias void delegate(T) Callback; 10 11 /// Array of delegates making up this multi-delegate. 12 Callback[] dgs; 13 14 /// Call each delegate. 15 void opCall(T args); 16 17 /// Add the given delegate. 18 void opCatAssign(Callback dg); 19 20 /// Remove the given delegate, if present. 21 void remove(Callback dg); 22 23 /// Read-only property returns true if no delegates are in this multi-delegate. 24 bool isEmpty; 5 25 } 6 26 27 /** 28 Multi-delegate where the delegates return a bool result. 29 */ 7 30 struct MultiBoolDelegate(T...) 8 31 { 32 /// Alias for delegate type. 33 alias bool delegate(T) Callback; 34 35 /// Array of delegates making up this multi-delegate. 36 Callback[] dgs; 37 38 /// Call each delegate and return the logical-or of the results. 39 bool opCall(T args); 40 41 /// Add the given delegate. 42 void opCatAssign(Callback dg); 43 44 /// Remove the given delegate, if present. 45 void remove(Callback dg); 46 47 /// Read-only property returns true if no delegates are in this multi-delegate. 48 bool isEmpty; 9 49 }
