Changeset 16

Show
Ignore:
Timestamp:
12/04/06 09:33:21 (2 years ago)
Author:
lindquist
Message:

Documentation update. API ref now matches the old trunk/minwin/index.html plus a little extra.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/minwin/docs/builddocs.bat

    r14 r16  
    55dmd -D minwin.ddoc minwin/event.d -c -o- 
    66dmd -D minwin.ddoc minwin/geometry.d -c -o- 
     7dmd -D minwin.ddoc minwin/group.d -c -o- 
    78dmd -D minwin.ddoc minwin/icon.d -c -o- 
    89dmd -D minwin.ddoc minwin/image.d -c -o- 
     
    1213dmd -D minwin.ddoc minwin/paint.d -c -o- 
    1314dmd -D minwin.ddoc minwin/peer.d -c -o- 
     15dmd -D minwin.ddoc minwin/peerimpl.d -c -o- 
    1416dmd -D minwin.ddoc minwin/window.d -c -o- 
     17 
     18dmd -D minwin.ddoc minwin/index.d -c -o- 
    1519pause 
  • 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 
     8html,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 
     18body 
     19{ 
     20    background-color: white; 
     21} 
     22 
     23dd 
     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 
     38a.toc 
     39{ 
     40    margin-left: 0.5em; 
     41} 
     42 
    143#toc 
    244{ 
    345    vertical-align: top; 
    4     padding: 10px; 
     46    padding-left: 1em; 
     47    padding-right: 3em; 
     48 
    549} 
    650 
     
    852{ 
    953    vertical-align: top; 
     54    padding-left: 0; 
     55    padding-right: 2em; 
    1056} 
     57 
     58dl.class 
     59{ 
     60    background-color: WhiteSmoke; 
     61    margin-bottom: 1em; 
     62    padding: 0.5em; 
     63} 
     64 
     65table.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 
    19WIN = $(RED Windows) 
    210MOTIF = $(GREEN Motif) 
    311GTK = $(BLUE GTK) 
     12 
     13PAGE_TITLE = <h1 class="title">$(TITLE)</h1> 
    414 
    515DDOC = <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" 
     
    1222</head> 
    1323<body> 
    14 <h1>$(TITLE)</h1> 
     24$(PAGE_TITLE) 
    1525<table> 
    1626<tr> 
     
    2737</html> 
    2838 
    29 INDEX_LINK = $(LINK2 $0.html,$0) 
     39INDEX_LINK = <a href="$0.html" class="toc">$0</a> 
     40INDEX_PACKAGE = <h3 class="package">$0</h3> 
    3041 
    31 INDEX = $(INDEX_LINK app) $(BR) 
     42BR = <br /> 
     43 
     44INDEX = $(INDEX_PACKAGE minwin) 
     45        $(INDEX_LINK app) $(BR) 
    3246        $(INDEX_LINK button) $(BR) 
    3347        $(INDEX_LINK component) $(BR) 
    3448        $(INDEX_LINK dialog) $(BR) 
    3549        $(INDEX_LINK event) $(BR) 
     50        $(INDEX_LINK geometry) $(BR) 
     51        $(INDEX_LINK group) $(BR) 
    3652        $(INDEX_LINK icon) $(BR) 
    3753        $(INDEX_LINK image) $(BR) 
     54        $(INDEX_LINK layout) $(BR) 
    3855        $(INDEX_LINK menu) $(BR) 
    3956        $(INDEX_LINK multidg) $(BR) 
    4057        $(INDEX_LINK paint) $(BR) 
    4158        $(INDEX_LINK peer) $(BR) 
    42         $(INDEX_LINK geometry) $(BR) 
     59        $(INDEX_LINK peerimpl) $(BR) 
    4360        $(INDEX_LINK window) $(BR) 
     61 
     62CLASS_DL = <dl class="class">$0</dl> 
     63 
     64DDOC_CLASS_MEMBERS = $(CLASS_DL $0) 
     65 
     66BORDERLAYOUT_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 
     72H1 = <h1>$0</h1> 
     73H2 = <h2>$0</h2> 
     74H3 = <h3>$0</h3> 
  • trunk/minwin/docs/minwin/dialog.d

    r14 r16  
    33import minwin.window; 
    44 
     5/// A dialog box for modal interactions. 
    56class Dialog : AbstractWindow 
    67{ 
     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; 
    722} 
     23 
     24/// Structure for specifying a filter in a file dialog. 
     25struct 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. 
     35struct 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. 
     52bool 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. 
     54bool saveFileDialog(AbstractWindow owner, inout FileDialogData data); 
     55 
     56/// Show a modal information dialog with given text, title and owner. 
     57void informationDialog(AbstractWindow owner, char[] text, char[] title); 
     58/// Show a modal warning dialog with given text, title and owner. 
     59void warningDialog(AbstractWindow owner, char[] text, char[] title); 
     60/// Show a modal error dialog with given text, title and owner. 
     61void errorDialog(AbstractWindow owner, char[] text, char[] title); 
     62/// Show a modal message dialog with given text, title and owner. 
     63void messageDialog(AbstractWindow owner, char[] text, char[] title); 
  • trunk/minwin/docs/minwin/event.d

    r14 r16  
    11module minwin.event; 
    22 
     3import minwin.geometry; 
     4 
     5/// Enumeration of modifier keys. Can be or'd together. 
     6enum 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). 
     21alias void* EventNative; 
     22 
     23/// Struct wrapping the native generic event type. 
    324struct Event 
    425{ 
     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; 
    532} 
    633 
     34/// Platform-specific generic key event type (eg, MSG, XKeyEvent, GdkKeyEvent). 
     35alias void* KeyEventNative; 
     36 
     37/// Struct wrapping the native key event type. 
    738struct KeyEvent 
    839{ 
     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; 
    948} 
     49/// Platform-specific id for key character press events. 
     50alias uint KeyPressedEvent; 
     51/// Platform-specific id for key down events. 
     52alias uint KeyDownEvent; 
     53/// Platform-specific id for key up events. 
     54alias uint KeyUpEvent; 
    1055 
     56/// Platform-specific generic mouse event type (eg, MSG, XMouseEvent, GdkMouseEvent). 
     57alias void* MouseEventNative; 
     58 
     59/// Struct wrapping the native mouse event type. 
    1160struct MouseEvent 
    1261{ 
     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; 
    1370} 
     71/// Platform-specific id for mouse moved events. 
     72alias uint MouseMovedEvent; 
     73/// Platform-specific id for 1st mouse button down events. 
     74alias uint MouseDownEvent; 
     75/// Platform-specific id for 1st mouse button up events. 
     76alias uint MouseUpEvent; 
     77/// Platform-specific id for 2nd mouse button down events. 
     78alias uint MouseAlt1DownEvent; 
     79/// Platform-specific id for 2nd mouse button up events. 
     80alias uint MouseAlt1UpEvent; 
     81/// Platform-specific id for 3rd mouse button down events. 
     82alias uint MouseAlt2DownEvent; 
     83/// Platform-specific id for 3rd mouse button up events. 
     84alias uint MouseAlt2UpEvent; 
    1485 
     86/// Platform-specific generic window event type (eg, MSG, XConfigureEvent, GdkEventConfigure). 
     87alias void* WindowEventNative; 
     88 
     89/// Struct wrapping the native window event type. 
    1590struct WindowEvent 
    1691{ 
     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; 
    17100} 
     101/// Platform-specific id for window size events. 
     102alias uint WindowSizeEvent; 
     103/// Platform-specific id for window sizing events. 
     104alias uint WindowSizingEvent; 
     105/// Platform-specific id for window move events. 
     106alias uint WindowMoveEvent; 
     107/// Platform-specific id for window moving events. 
     108alias uint WindowMovingEvent; 
     109 
     110/** 
     111Waits for the next event from the event queue. Blocks until event is available. 
     112 
     113The event is removed from the queue. 
     114 
     115Returns: false on quit event, true on all others. 
     116*/ 
     117bool nextEvent(Event* event); 
     118 
     119/** 
     120Retrieves the next event from the event queue (if possible). Returns immediately. 
     121 
     122The event is removed from the queue. 
     123 
     124Returns: true is an event was available, false if not. 
     125*/ 
     126bool peekEvent(Event* event); 
     127 
     128/** 
     129Passes event on to the backend for processing in the event loop. 
     130*/ 
     131void dispatchEvent(Event* event); 
  • trunk/minwin/docs/minwin/layout.d

    r14 r16  
    11module minwin.layout; 
    22 
    3 class LayoutManager 
     3import minwin.component; 
     4import minwin.geometry; 
     5 
     6/// Interface for positioning out children in a component. 
     7interface LayoutManager 
    48{ 
     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(); 
    515} 
     16 
     17/// Enumeration of possible layout directions. 
     18enum 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. 
     28class 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. 
     53class 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. 
     70enum Loc 
     71{ 
     72    /// 
     73    North, 
     74    /// 
     75    South, 
     76    /// 
     77    East, 
     78    /// 
     79    West, 
     80    /// 
     81    Center 
     82} 
     83 
     84/** 
     85A layout manager that positiions children like Java's BorderLayout 
     86 
     87$(BORDERLAYOUT_TABLE) 
     88*/ 
     89class 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  
    11module minwin.multidg; 
    22 
     3/** 
     4Store multiple delegates with any number of arguments. 
     5*/ 
    36struct MultiDelegate(T...) 
    47{ 
     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; 
    525} 
    626 
     27/** 
     28Multi-delegate where the delegates return a bool result. 
     29*/ 
    730struct MultiBoolDelegate(T...) 
    831{ 
     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; 
    949}