| |
|
|
Thomas Freier | Can prevent, that the Button at Hover or to the Click XP To W7 his Appearance changed? |
|
|
| Gruß Thomas Windows XP SP2, XProfan X2 | 06/06/10 ▲ |
|
|
|
|
Jörg Sellmeyer | prevent, that it his Appearance not changed? double negation solid? somehow understand I The question none... |
|
|
| Windows XP SP2 XProfan X4... und hier mal was ganz anderes als Profan ... | 06/06/10 ▲ |
|
|
|
|
Thomas Freier | @Jörg, is correct, was too much. means with Hover no Fabumschlag and to Click one Punktrahmen. The alternative is naturally a Bmp and query where one Click instead of found. |
|
|
| Gruß Thomas Windows XP SP2, XProfan X2 | 06/06/10 ▲ |
|
|
|
|
Rolf Koch | because of the Punkterahmen: Perhaps (only a banale idea) a unsichtbaren funktionslosen Button create and to Click dummymässig to the Focus uneasily? Siehste, so what there under windows 7 not any more (disgusting Punktrahmen) |
|
|
| |
|
|
|
ByteAttack | Well. either via Picture one's own Button create, or simply SKControl [...] using. |
|
|
| |
|
|
|
| Thomas suitor, Beitrag=57377, Zeitpunkt=06.06.2010
Can prevent, that the Button at Hover or to the Click XP To W7 his Appearance changed?
Hello Thomas,
to EnableWindow button&,0 .
or such hässlicher Konstrukt: CompileMarkSeparation {$cleq}
cls
long myButton=createMySonderButton(hWnd,"Hallo Welt",10,10,100,100)
whilenot key
waitInput
case clicked(myButton) : messageBox "","",0
wend
deleteObject getWindowLong(myButton,gwl_userData)
end
proc createMySonderButton(long parent,string text,long x,y,xx,yy)
long myButton=create("button",parent,text,x,y,xx,yy)
mcls xx,yy
startPaint myButton
copyBmpToMem 0,0 - xx,yy > 0,0
endPaint
long myHPic=create("hNewPic",xx,yy,0)
startPaint myHPic
mCopyBmp 0,0 - xx,yy > 0,0;0
endPaint
setWindowLong(myButton,gwl_userData,myHPic)
subClass myButton,true
return myButton
endproc
subClassProc
if subClassMessage(myButton,wm_paint)
set("winProc",0)
startPaint myButton
drawPic getWindowLong(myButton,gwl_userData),0,0;0
endPaint
validateRect(myButton,0)
return 1
endif
endproc
simply ists imho you don't say so. ^^ CompileMarkSeparation $H windows.ph
cls
var myButton&=createMySonderButton(%hWnd,"Hallo Welt",10,10,100,100)
whilenot %key
waitInput
case clicked(myButton&) : messageBox "","",0
wend
deleteObject ~getWindowLong(myButton&,~gwl_userData)
end
proc createMySonderButton
parameters parent&,Text$,x&,y&,xx&,yy&
var myButton&=create("button",parent&,Text$,x&,y&,xx&,yy&)
mcls xx&,yy&
startPaint myButton&
copyBmpToMem 0,0 - xx&,yy& > 0,0
EndPaint
var myHPic&=create("hNewPic",xx&,yy&,0)
startPaint myHPic&
mCopyBmp 0,0 - xx&,yy& > 0,0;0
EndPaint
~setWindowLong(myButton&,~gwl_userData,myHPic&)
subClass myButton&,1
return myButton&
endproc
subClassProc
if subClassMessage(myButton&,15)//wm_paint
set("winProc",0)
startPaint myButton&
drawPic ~getWindowLong(myButton&,~gwl_userData),0,0;0
EndPaint
~validateRect(myButton&,0)
return 1
endif
endproc
But "Murx" at least z.B. because the control only correctly displayed becomes if it sichbar (not covers) _erzeugt watts.
for so simple Spielereien but vlt. enough - i'd well sooner (as well as already suggested) one Bitmap(-Static) benefit instead of such Konstrukt. ^^ |
|
|
| |
|
|
|
ByteAttack | here time one simple example one Hover-Button under XProfan: CompileMarkSeparationUSERMESSAGES 16
Declare appexit%,Button&,Hover&
Set("TrueColor",1)
WindowStyle 26
WindowTitle "Hover-Button"
Window ((%maxX/2)-320),((%maxY/2)-240)-640,480
Lade Button
Button&=Create("HPic",-1,$ProgDir+"button_a.bmp")
Lade HoverButton
Hover&=Create("HPic",-1,$ProgDir+"button_b.bmp")
Zeichne Button
DrawPic Button&,10,10;0
WhileNot appexit%
GetMessage
Case %Umessage=16:appexit%=1
if Mouse(10,10-135,50) Wenn MouseOver Button
DrawPic Hover&,10,10;0 Zeichne Hover
While Mouse(10,10-135,50)
Warten auf Mausereigniss wenn MouseOver Button
EndWhile
DrawPic Button&,10,10;0 MouseOut
endif
EndWhile
DeleteObject Button&
DeleteObject Hover&
end
example in the attachment |
|
|
| |
|
|
|
Paul Glatz | CompileMarkSeparationcls
var myButton&=Button(%hWnd,"Hallo Welt",10,10,100,100)
whilenot %key
waitInput
case clicked(myButton&) : messageBox "","",0
wend
end
proc Button
parameters parent&,text$,x&,y&,xx&,yy&
var myButton&=create("button",parent&,text$,x&,y&,xx&,yy&)
mcls xx& + 2,yy& + 2
startPaint myButton&
copyBmpToMem 0,0 - xx&,yy& > 0,0
endPaint
var myHPic&=create("hNewPic",xx&,yy&,0)
startPaint myHPic&
mCopyBmp 0,0 - xx&,yy& > 0,0;0
endPaint
destroyWINDOW(mybutton&)
mybutton& = Create("PicButton",parent&,myHPic&,x&,y&,xx& + 1,yy& + 1)
deleteObject myHPic&
return myButton&
endproc
|
|
|
| |
|
|
|
Thomas Freier | thanks for Notes. there The SKControl ohnehin in the program in use is, was is the least hoisted a SKCtrl_CreateUserButton einzusetzen. |
|
|
| Gruß Thomas Windows XP SP2, XProfan X2 | 06/07/10 ▲ |
|
|
|