Sie befinden sich auf der NewGUI Sourcepage

Start
Über NewGui
Featureübersicht
Changesübersicht
Installation
Download
Demos
Anwendungen
Tutorials
Sourcecodes
-Button Beispiel
-Checkbox Beispiel
-TextEditor
-Flächen & Füllroutinen
-Eingabegadgets
-
Links
Kontakt

Unser Hostingpartner

; 
; 
; (c) 2003 Cyborg 

    {* Include sys:coder/preass/Options.p *}

    {* String: Version=": (C) CYBORG 2003"*}

    {* usefd:sys:coder/fd/newgui_lib.fd *}

    {* Include sources:newgui/generic/defines.i *}
    {* Include module:sprintf.p *}

    {* Array[String]: CycleStrings,"Dieses Cycle Gadget...","... gibt nur das aktuelle...","...Cyclevalue wieder."*}

Start:
    Gui=Open_Window(150,100,600,200,"TESTWINDOW",#WFLG_DRAGBAR!WFLG_REPORTMOUSE!WFLG_Sizegadget!WFLG_DEPTHGADGET!WFLG_CLOSEGADGET!WFLG_RMBTRAP!WFLG_SMART_REFRESH,#IDCMP_MOUSEBUTTONS!IDCMP_ACTIVEWINDOW!IDCMP_MOUSEMOVE,0)
    if gui#0
     {
       CreateGadgetGeneric(Gui,100,010,400,015,"Checkbox Beispiel #1",0,0,0,"generic/bevelbox.library",0)
       CreateGadgetGeneric(Gui,90,160,015,015,"Checkbox",0,0,0,"generic/checkbox.library",>checktabs:NG_TEXT_POS,NG_RIGHT|
                                                                                                      TAG_DONE,NULL)
       
       CreateGadgetGeneric(Gui,010,160,070,015,"Ghost",0,0,0,"generic/roundbutton.library",>roundtags:NG_ROUNDBUTTON_DX,10|
                                                                                                      TAG_DONE,NULL)
       CreateGadgetGeneric(Gui,520,160,070,015,"DeGhost",0,0,0,"generic/roundbutton.library",&RoundTags)

       CreateGadgetGeneric(Gui,100,060,400,015,"Textgadget",0,0,0,
                           "generic/text.library",>TextGadget10:NG_TEXT_POS,NG_RIGHT|
                                                                NG_VALUE,TEST_TEXT="check"|
                                                                NG_NB_LISTEN,1|
                                                                NG_NB_STEP,1|
                                                                NG_INVERSE,0|
                                                                NG_PEN_F_UP,1|
                                                                NG_PEN_BG_UP,0|
                                                                NG_PEN_F_DOWN,2|
                                                                NG_PEN_BG_DOWN,3|
                                                                NG_BORDER,1|
                                                                tag_done,null)

       CreateGadgetGeneric(Gui,100,085,400,015,"Textgadget",0,0,0,
                           "generic/text.library",>TextGadget01:NG_TEXT_POS,NG_RIGHT|
                                                                NG_VALUE,TEST_TEXT|
                                                                NG_NB_LISTEN,1|
                                                                NG_NB_STEP,1|
                                                                NG_INVERSE,0|
                                                                NG_PEN_F_UP,1|
                                                                NG_PEN_BG_UP,0|
                                                                NG_PEN_F_DOWN,2|
                                                                NG_PEN_BG_DOWN,3|
                                                                NG_BORDER,1|
                                                                tag_done,null)

       CreateGadgetGeneric(Gui,100,105,400,015,"Cyclegadget",0,0,0,
                           "generic/cycle.library",>CycleGadget1:NG_TEXT_POS,NG_LEFT|
                                                                 NG_VALUE,CycleStrings|
                                                                 NG_CYCLE_ICON,0|
                                                                 tag_done,null)

       CreateGadgetGeneric(Gui,100,125,400,015,"Cyclegadget",0,0,0,
                           "generic/cycle.library",>CycleGadget2:NG_TEXT_POS,NG_LEFT|
                                                                 NG_VALUE,CycleStrings|
                                                                 tag_done,null)

       CreateGadgetGeneric(Gui,420,160,070,015,"SnapShot",0,0,0,"generic/roundbutton.library",&RoundTags)


       textbuffer=malloc(2000)

       gadget==0
        class==0

       Loadsnapshot(Gui,0)


       while class##IDCMP_Closewindow 
        { 
          (Gadget,Class)=WaitGuiEvent(Gui,0)

          if gadget#0
           {
             status=getGadgetStatus(Gui,Gadget)

             if class=#idcmp_mousebuttons
              {
                 if status=2
                  {
                    SPrintf(Textbuffer,"Es wird Gadget %lu gedrückt!",>Tags3:*gadget,0)
                    UpdateGadgetValue(Gui,5,TextBuffer)

                  }
                 if status=0
                  {
                    SPrintf(Textbuffer,"Es wird Gadget %lu losgelassen!",>[Tags3]:*gadget,0)
                    UpdateGadgetValue(Gui,5,TextBuffer)
                  }

                 if gadget=3
                  {
                    ghostGadget(gui,2)
                    ghostGadget(gui,7)
                  }
                 if gadget=4
                  {
                    deghostGadget(gui,2)
                    deghostGadget(gui,7)
                  }
                 if gadget=7
                  {
                    value=getGadgetValue(Gui,7)
                    SPrintf(Textbuffer,"CycleValue = %ld !",>[Tags3]:*value,0)
                    UpdateGadgetValue(Gui,6,TextBuffer)
                  }
                 if gadget=9
                  {
                    snapshot(Gui,0)
                  }
              }
             if class=#idcmp_mousemove
              {
                 if status=1
                  {
                    SPrintf(Textbuffer,"MouseOver %lu",>[Tags3]:*gadget,0)
                    UpdateGadgetValue(Gui,5,TextBuffer)
                  }
              }
           }
          if class=#idcmp_vanillakey
           {
                       
             MsgChar=getPressedKey(Gui)

            
             Sprintf(Textbuffer,"Es wurde die Taste \$22%lc\$22 ( %lu ) gedrückt.",>tags1:*msgchar,*msgchar,0)

             UpdateGadgetValue(Gui,5,TextBuffer)

           }
        }

       Close_Window(Gui)
     }
    error==0

    printf("Ende\n")
    {* Return *}