; (c) 2003 Cyborg
{* Include sys:coder/preass/Options.p *}
{* String: Version=": Demo X (C) CYBORG 2003"*}
{* usefd:sys:coder/fd/newgui_lib.fd *}
{* Structure DeepStruct,Name(APTR),Chunky(APTR),Weite(LONG),Hoehe(LONG),Next(APTR)*}
{* Include sources:newgui/generic/defines.i *}
{* Include module:sprintf.p *}
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
{
if (Deep1=CreateDeep(Gui,"mouseover.deep"))=0
{
Close_Window(Gui)
printf("Fehler: Deepgrafik 1 konnte nicht erstellt werden!
")
{* Return *}
}
if (Deep2=CreateDeep(Gui,"down.deep"))=0
{
FreeDeep(deep1)
Close_Window(Gui)
printf("Fehler: Deepgrafik 2 konnte nicht erstellt werden!
")
{* Return *}
}
result=CreateGadgetGeneric(Gui,100,010,400,015,"Button Beispiel #1",0,0,0,"generic/bevelbox.library",0)
result=CreateGadgetGeneric(Gui,265,140,070,050,"Button",0,deep1,deep2,"generic/button.library",0)
result=CreateGadgetGeneric(Gui,010,160,070,015,"Ghost",0,0,0,"generic/roundbutton.library",>roundtags:NG_ROUNDBUTTON_DX,10|
TAG_DONE,NULL)
result=CreateGadgetGeneric(Gui,520,160,070,015,"DeGhost",0,0,0,"generic/roundbutton.library",&RoundTags)
result=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)
textbuffer=malloc(2000)
gadget==0
class==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)
}
if gadget=4
{
deghostGadget(gui,2)
}
}
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)
}
}
FreeDeep(Deep1)
FreeDeep(Deep2)
Close_Window(Gui)
}
error==0
printf("Ende\n")
{* Return *}
|