6 Standard dialog boxes

QTk offers the following standard dialog boxes:

If the application runs on a Windows platform, the first 3 dialog boxes are the standard one from Windows.

6.1 Save and load dialog boxes

The save and load dialog boxes are spawned by:

{QTk.dialogbox save(defaultextension:DE
                    filetypes:FT
                    initialdir:ID
                    initialfile:IF
                    title:Title
                    1:R)}

and

{QTk.dialogbox load(defaultextension:DE
                    filetypes:FT
                    initialdir:ID
                    initialfile:IF
                    title:Title
                    1:R)}

Example:

Result={QTk.dialogbox load(defaultextension:"qdw" 
                           initialdir:"." 
                           title:"Load QTkDrawing..." 
                           initialfile:"" 
                           filetypes:q(q("QTkDraw files" q(".qdw"))
                                       q("All files" q("*"))) $)}

The parameters are:

6.2 Color dialog box

The color dialog box is spawned by:

{QTk.dialogbox color(initialcolor:IC
                     title:Title
                     1:R)}

Example:

Result={QTk.dialogbox color(initialcolor:c(255 0 0)
                            title:"Select a color..." $)}

The parameters are:

6.3 Print Canvas dialog box

Canvases can be printed by their postscript method. The print canvas dialog box can be used to let the user interactively specify all the parameters of this method. To help the user correctly choose the area to print, a rough copy of the canvas is done inside the dialog box.

The print canvas dialog box is spawned by:

{QTk.dialogbox printcanvas(canvas:C
                           title:Title
                           region:R
                           zoom:Z
                           rotate:R
                           fit:F
                           pagewidth:PW
                           pageheight:PH
                           pagex:PX
                           pagey:PY
                           width:W
                           height:H
                           colormode:CM
                           x:X
                           y:Y
                           1:R)}

Example:

C
{{QTk.build td(canvas(glue:nswe handle:C))} show}
{C create(rectangle 10 10 100 100)}
Result={QTk.dialogbox printcanvas(canvas:C $)}
{C postscript(colormode:Result.colormode
              pagewidth:Result.pagewidth
              pagex:0.0
              pagey:0.0
              pageanchor:sw
              rotate:Result.rotate
              width:Result.tkwidth
              height:Result.tkheight
              x:Result.tkx
              y:Result.tky
              file:"out.ps")

The parameters are:


Donatien Grolaux
Version 1.3.0 (20040413)