Source / code snippets | | | | Jörg Sellmeyer |
$H windows.ph
SubProc Create.XBitmap
Parameters hwnd&,hPic&,x%,y%,ToolTip$,ExtStyle%
Case %pcount = 5:ExtStyle% = 0
If ExtStyle% = 1
ExtStyle% = ~WS_EX_DLGMODALFRAME
ElseIf ExtStyle% = 2
ExtStyle% = ~WS_EX_CLIENTEDGE
ElseIf ExtStyle% = 3
ExtStyle% = ~WS_EX_CLIENTEDGE | ~WS_EX_DLGMODALFRAME
EndIf
SizeOf(hPic&)
Var hdl& = Control("STATIC","test",$5400090E,x%,y%,%bmpx,%bmpy,hwnd&,0,%hinstance,ExtStyle%)
SendMessage(hdl&,~STM_SETIMAGE,0,hPic&)
Create("Tooltip",hwnd&,hdl&,ToolTip$)
Return hdl&
ENDPROC
Cls
ChDir $WinPath
Print FindFirst$("*.bmp"),
If %Ioresult
Print "Keine Images vorhanden"
WaitInput
End
Else
print FindNext$(),FindNext$(),FindNext$()
EndIf
Var hPic1& = Create("hSizedPic",-1,FindFirst$("*.bmp"),80,80,1)
Var hPic2& = Create("hSizedPic",-1,FindNext$(),80,80,1)
Var hPic3& = Create("hSizedPic",-1,FindNext$(),80,80,1)
Var hPic4& = Create("hSizedPic",-1,FindNext$(),80,80,1)
var h1& = Create("XBitmap",%hwnd,hPic1&,10,100,FindFirst$("*.bmp"),2)
var h2& = Create("XBitmap",%hwnd,hPic2&,110,100,FindNext$(),1)
var h3& = Create("XBitmap",%hwnd,hPic3&,210,100,FindNext$(),2)
var h4& = Create("XBitmap",%hwnd,hPic4&,310,100,FindNext$(),3)
AddStrings(0,Str $( hpic1&))
AddStrings(0,Str $( hpic2&))
AddStrings(0,Str $( hpic3&))
AddStrings(0,Str $( hpic4&))
Randomize
Declare bild&
Print "einfach times the Images anklicken"
While 1
WaitInput
bild& = Val(GetString$(0,Rnd(4)))
If %key = 27
Break
ElseIf (&wparam = h1&) Or (&lparam = h1&)
~LockWindowUpdate(h1&)
SendMessage(h1&,~STM_SETIMAGE,0,bild&)
~LockWindowUpdate(0)
ElseIf (&wparam = h2&) Or (&lparam = h2&)
SendMessage(h2&,~STM_SETIMAGE,0,bild&)
ElseIf (&wparam = h3&) Or (&lparam = h3&)
SendMessage(h3&,~STM_SETIMAGE,0,bild&)
ElseIf (&wparam = h4&) Or (&lparam = h4&)
SendMessage(h4&,~STM_SETIMAGE,0,bild&)
EndIf
Wend
DeleteObject hPic1&,hPic2&,hPic3&,hPic4&
|
| | | Windows XP SP2 XProfan X4... und hier mal was ganz anderes als Profan ... | 11/11/11 ▲ |
| |
| | | what I pity find is the one Bitmaps somehow not flickerfrei new Images allocate can. |
| | | | |
| | Jörg Sellmeyer | with whom small Images falls not so on but self with LockWindowUpdate sees one ex and on so a weißen wander. Dou you mean the? |
| | | Windows XP SP2 XProfan X4... und hier mal was ganz anderes als Profan ... | 11/11/11 ▲ |
| |
| | | whether small or big... is hold The question how much Time the computer strain has etc...
with more Bitmaps falls the naturally sooner on.
must time z.B. very fix update z.B. 50 Images per second or many small Bitmaps. . |
| | | | |
| | | such directly in XProfan eingbautes Canvas ( [...] ) would the Brüller but standing Yes evident not even to Discussion though it simply umzusetzen is there in the principle only one hPic with wmPaint painted go must. Virtually one create.canvas the one Control/ Window prepares the one hPic zugeordnet go can which drawn becomes with wm_paint. (it must Yes not same a scrollbare Zeichenfläche his How tappt im dunkeln from the Inc created becomes The dynamic by Proc draw instead of one hPic.) |
| | | | |
| | Jörg Sellmeyer | yet More Spielereien with Tooltips and Bitmaps. in a, whether the so "statthaft" is. But lustich:
Window %maxx,%maxy
Declare hBmp&,t&
ChDir $winpath
AddFiles "*.bmp"
Declare hPic&[],hBack&[]
Var y% = 2
Declare bmptext$
WhileLoop 0,%getcount'-270
hPic&[&Loop] = Create("hSizedPic",-1,GetString$(0,&Loop),80,80,1)
hBmp& = Create("Bitmap",%hwnd,hPic&[&Loop],5 + (&Loop Mod 23) * 81,y%)
hBack&[&Loop] = Create("hSizedPic",-1,GetString$(0,&Loop),380,380,1)
bmptext$ = MkStr$(Space$(%bmpx \ 3) + "\n",%bmpy \ 13)
t& = Create("Tooltip",%hwnd,hBmp&,bmptext$)
SetText t&, %hwnd, 0,"",0,GetString$(0,&Loop)
'the bewirkt unfortunately nothing
' SetWindowPos t & = 2000,0 - %bmpx,%bmpy;1
Create("Bitmap",t&,hBack&[&Loop],10,30)
SetStyle hBmp&,GetStyle(hbmp&) | $100
Casenote (&Loop + 1) Mod 23:Inc y%,80
Window Title Str $(%getcount - &Loop)
Wend
Print "fertig!"
Randomize
While 1
Waitinput
If IsKey(27)
Break
EndIf
Wend
WhileLoop 0,SizeOf(hPic&[])-1
DeleteObject hPic&[&Loop],hBack&[&Loop]
Wend
|
| | | Windows XP SP2 XProfan X4... und hier mal was ganz anderes als Profan ... | 11/15/11 ▲ |
| |
| | | Öhm... by me here strain under Vista see I ("nur") one white Window with the spending "fertig!".
|
| | | | |
| | Jörg Sellmeyer | have Thou Bitmaps in the Windowsordner? otherwise pass whom way still at times. goes indeed with all others Formaten, if you whom code properly änderst. |
| | | Windows XP SP2 XProfan X4... und hier mal was ganz anderes als Profan ... | 11/16/11 ▲ |
| |
| | | Hmpf, X11 gives me naturally with this instruction: The Message:
from.
means fix first XProfan12 zusammengesucht I on this computer here yet "neu" be and see there:
only right the edge between Image and ToolTip-edge isn't so wide How left. |
| | | | |
| | Jörg Sellmeyer |
only right the edge between Image and ToolTip-edge isn't so wide How left.
Yes, The Platzierung is very rudimentär, there SetWindowPos apparently not functions with Tooltips. |
| | | Windows XP SP2 XProfan X4... und hier mal was ganz anderes als Profan ... | 11/16/11 ▲ |
| |
| | Jörg Sellmeyer | I probier strain time from, the on a dialog auszulagern and peng - is not is the now ne profaneigene Schikane or wants windows not? on the dialog comes of course the Click with right through but the left Click only, if it as Double click results. is still plöd!
$H windows.ph
SubProc Create.XBitmap
Parameters hwnd&,hPic&,x%,y%,ToolTip$,ExtStyle%
Case %pcount = 5:ExtStyle% = 0
If ExtStyle% = 1
ExtStyle% = ~WS_EX_DLGMODALFRAME
ElseIf ExtStyle% = 2
ExtStyle% = ~WS_EX_CLIENTEDGE
ElseIf ExtStyle% = 3
ExtStyle% = ~WS_EX_CLIENTEDGE | ~WS_EX_DLGMODALFRAME
EndIf
SizeOf(hPic&)
Var hdl& = Control("STATIC","test",$5400090E,x%,y%,%bmpx,%bmpy,hwnd&,0,%hinstance,ExtStyle%)
SendMessage(hdl&,~STM_SETIMAGE,0,hPic&)
Create("Tooltip",hwnd&,hdl&,ToolTip$)
Return hdl&
ENDPROC
Cls
Var dlg& = Create("Dialog",%hwnd,"Test",%winLeft + 50,%wintop + 100,600,400)
ChDir $WinPath
Print FindFirst$("*.bmp"),
If %Ioresult
Print "Keine Images vorhanden"
WaitInput
End
Else
print FindNext$(),FindNext$(),FindNext$()
EndIf
Var hPic1& = Create("hSizedPic",-1,FindFirst$("*.bmp"),80,80,1)
Var hPic2& = Create("hSizedPic",-1,FindNext$(),80,80,1)
Var hPic3& = Create("hSizedPic",-1,FindNext$(),80,80,1)
Var hPic4& = Create("hSizedPic",-1,FindNext$(),80,80,1)
var h1& = Create("XBitmap",dlg&,hPic1&,10,100,FindFirst$("*.bmp"),2)
var h2& = Create("XBitmap",dlg&,hPic2&,110,100,FindNext$(),1)
var h3& = Create("XBitmap",dlg&,hPic3&,210,100,FindNext$(),2)
var h4& = Create("XBitmap",dlg&,hPic4&,310,100,FindNext$(),3)
AddStrings(0,Str $( hpic1&))
AddStrings(0,Str $( hpic2&))
AddStrings(0,Str $( hpic3&))
AddStrings(0,Str $( hpic4&))
Randomize
Declare bild&
Print "einfach times the Images anklicken"
While 1
WaitInput
bild& = Val(GetString$(0,Rnd(4)))
If %key = 27
Break
ElseIf (&wparam = h1&) Or (&lparam = h1&)
print "a"
~LockWindowUpdate(h1&)
SendMessage(h1&,~STM_SETIMAGE,0,bild&)
~LockWindowUpdate(0)
ElseIf (&wparam = h2&) Or (&lparam = h2&)
SendMessage(h2&,~STM_SETIMAGE,0,bild&)
ElseIf (&wparam = h3&) Or (&lparam = h3&)
SendMessage(h3&,~STM_SETIMAGE,0,bild&)
ElseIf (&wparam = h4&) Or (&lparam = h4&)
SendMessage(h4&,~STM_SETIMAGE,0,bild&)
EndIf
Wend
DeleteObject hPic1&,hPic2&,hPic3&,hPic4&
|
| | | | |
|
Zum QuelltextTopic-Options | 14.502 Views |
Themeninformationenthis Topic has 2 subscriber: |