home *** CD-ROM | disk | FTP | other *** search
/ PC World 2000 December / PCWorld_2000-12_cd.bin / Komunikace / Comanche / gui / guiBuilder.tcl < prev    next >
Text File  |  2000-11-02  |  2KB  |  60 lines

  1.  
  2. class guiBuilder {
  3.     method render {frame xuiObject} 
  4. }
  5.  
  6. body guiBuilder::render { frame xuiObject } {
  7.     switch  [$xuiObject getXuiClass]  {
  8.     boolean {
  9.         if [$xuiObject doYouBelongTo radioYesNo] {
  10.         return [ guiBooleanRadioButton ::#auto $frame $xuiObject ]
  11.         } else {
  12.         return [ guiBoolean ::#auto $frame $xuiObject ]
  13.         }
  14.     } choice {
  15.         if [$xuiObject doYouBelongTo multipleChoice] {
  16.            return [ guiMultipleChoice ::#auto $frame $xuiObject ]
  17.         } else {
  18.         return [ guiChoice ::#auto $frame $xuiObject ]
  19.         }
  20.     } string {
  21.         if [$xuiObject doYouBelongTo directory] {
  22.         return [ guiStringDirectory ::#auto $frame $xuiObject] 
  23.         } elseif [$xuiObject doYouBelongTo file] {
  24.         return [ guiStringFile ::#auto $frame $xuiObject]
  25.         } else {
  26.         return [ guiString ::#auto $frame $xuiObject]
  27.         }
  28.     } number {
  29.         return [ guiString ::#auto $frame $xuiObject]
  30.     } label {
  31.         return [ guiLabel ::#auto $frame $xuiObject]
  32.     } structure {
  33.         return [ guiStructure ::#auto $frame $xuiObject $this]
  34.     } alternate {
  35.         return [ guiAlternate ::#auto $frame $xuiObject $this]
  36.     } image {
  37.         return [ guiImage ::#auto $frame $xuiObject ]
  38.     } list {
  39.         return [ guiList ::#auto $frame $xuiObject $this]
  40.     } group {
  41.         return [ guiStructure ::#auto $frame $xuiObject $this]
  42.     } propertyPage {
  43.         return [ guiStructure ::#auto $frame $xuiObject $this]
  44.  
  45.     } propertyPages {
  46.             if {[llength [$xuiObject getComponents]] > 6} {
  47.         return [ guiPropertyPages ::#auto $frame $xuiObject $this]
  48.      } else {
  49.         return [guiPropertyPagesNotebook ::#auto $frame $xuiObject $this]
  50.      }
  51.     } default {
  52.         error "Type [$xuiObject getXuiClass] not recognized"
  53.     }
  54.     }
  55. }
  56.  
  57.  
  58.  
  59.  
  60.