| |
|
|
- Página 1 - |
|
Julian Schmidt | ¡Hola, Yo sería gerne de optischen Gründen una Ventana redactar el weiterhin skalierbar es, allerdings no Dicken Rahmen besitzt. Ist así algo posible?
LG
Julian57 |
|
|
| |
|
|
|
« Dieser Contribución wurde como Solución gekennzeichnet. » |
|
- Página 2 - |
|
Andreas Miethe
| IF (21.09.11)
Usted hast sí ya una fetten Block: caso (%mouseXheight(%hWnd)-10) : hwnd.scaleByMouse()
IF (21.09.11)
como kannst Usted doch el hWnd.scaleByMouse-Proc como Parámetro transferencia welche Ecke/ Kante gemeint war en a Ersparen el Usted el en el Proc sólo otra vez ermitteln musst.
Es me irgendwie gegen el Strich
Das se normalerweise en Message WM_NCHITTEST geregelt.
Hier veces una kleines Ejemplo para una skalier / verschiebbaren Button. Sollte se wohl para una Ventana adaptar dejar.
$H Windows.ph
$H Messages.ph
$H Structs.ph
STRUCT TRect = ~Rect
STRUCT TPoint = ~Punto
Proc HitTest
Parámetros hCtl&,lParam&
Declarar Punto#
Declarar Rect#
Dim Punto#,TPoint
Dim Rect#,TRect
Punto#.x& = LoWord(lParam&)
Punto#.y& = HiWord(lParam&)
~ScreenToClient(hCtl&,Punto#)
~GetWindowRect(hCtl&,Rect#)
~MapWindowPoints(~GetDesktopWindow(),%Hwnd,Rect#,2)
If (Punto#.y& < 4) AND (Punto#.x& < 4)
Disponer Punto#,Rect#
Volver ~HTTOPLEFT
ElseIf (Punto#.y& < 4) AND (Punto#.x& >= (Rect#.right& - Rect#.left&-4))
Disponer Punto#,Rect#
Volver ~HTTOPRIGHT
ElseIf (Punto#.y& >= (Rect#.bottom& - Rect#.top&-4)) AND (Punto#.x& >= (Rect#.right& - Rect#.left&-4))
Disponer Punto#,Rect#
Volver ~HTBOTTOMRIGHT
ElseIf (Punto#.x& < 4) AND (Punto#.y& >= (Rect#.bottom& - Rect#.top& - 4))
Disponer Punto#,Rect#
Volver ~HTBOTTOMLEFT
ElseIf Punto#.y& < 4
Disponer Punto#,Rect#
Volver ~HTTOP
ElseIf Punto#.x& < 4
Disponer Punto#,Rect#
Volver ~HTLEFT
ElseIf Punto#.x& >= (Rect#.right& - Rect#.left& - 4)
Disponer Punto#,Rect#
Volver ~HTRIGHT
ElseIf Punto#.y& >= (Rect#.bottom& - Rect#.top& - 4)
Disponer Punto#,Rect#
Volver ~HTBOTTOM
Más
Disponer Punto#,Rect#
Volver ~HTCAPTION
EndIf
ENDPROC
SubClassProc
If SubClassMessage(&sWnd,~WM_NCHITTEST)
Conjunto("WinProc", 0)
Volver HitTest(&swnd,&slParam)
Endif
ENDPROC
cls
Var Ende& = 0
Var Button& = Crear("Button",%hwnd,"OK",10,10,120,30)
SubClass Button&,1
whilenot ende&
waitinput
endwhile
|
|
|
| Gruss Andreas ________ ________ ________ ________ _ Profan 3.3 - XProfanX2 Win 95,98,ME,2000,XP,Vista - Win 7 32 / 64 Bit ASUS X93S - Intel Core I7-NVIDIA GForce 540M 8GB Arbeitsspeicher Homepage : [...] | 21.09.2011 ▲ |
|
|
|
|
|
| |
|
- Página 2 - |
|
| Yo weiß no si sinnvoller es z.B. en cada Mausbewegung en lugar de sólo einmalig después de Clic a prüfen en welchen Zona geklickt wurde. oO |
|
|
| |
|
|
|
Andreas Miethe
| Naja, zumindest se en Mausbewegung igual el richtige Cursor adecuado y no sólo después de ''KLICK'' |
|
|
| Gruss Andreas ________ ________ ________ ________ _ Profan 3.3 - XProfanX2 Win 95,98,ME,2000,XP,Vista - Win 7 32 / 64 Bit ASUS X93S - Intel Core I7-NVIDIA GForce 540M 8GB Arbeitsspeicher Homepage : [...] | 21.09.2011 ▲ |
|
|
|
|
| Hm, Será mejor que te va doch beim 1. Ejemplo dazu auch:
'URL: https://XProfan.com/intl/de/forum/skalierbares-fenster-redactar-sin-dicken-rahmen/
/*
{$ Cleq}
{$compiler c:\XProfan11\}
{$runtime c:\XProfan11\}
*/
windowstyle 1 | 2 | 8 | 16 | 512
window 640,480
mensajes de los usuarios 16,513,20//wm_close,wm_lButtonDown,wm_eraseBkGnd
subClass %hWnd,1
mientras que 1
waitInput
seleccionar %uMessage
caseof 16 : romper
caseof 513
caso (%mouseX>width(%hWnd)-10) and (%mouseY>height(%hWnd)-10) : hWnd.scaleByMouse()
EndSelect
wend
end
subClassProc
caso subClassMessage(%hWnd, 512):useCursor (%mouseX>width(%hWnd)-10) and (%mouseY>height(%hWnd)-10)*7//wm_mouseMove
endProc
proc hWnd.scaleByMouse
declarar m#
dim m#,8
external("user32","GetCursorPos",m#)
var omx%=long(m#,0)
var omy%=long(m#,4)
var wi&=%winRight-%winLeft
var he&=%winBottom-%winTop
mientras que isKey(1)
waitInput 10
external("user32","GetCursorPos",m#)
setWindowPos %hWnd=%winLeft,%winTop - wi&-omx%+long(m#,0),he&-omy%+long(m#,4)
wend
disponer m#
endProc
-
es sólo wm_mouseMove en lugar de wm_ncHitTest.
Apéndice: Ah, ahora sehe Yo, el Diferencia y Vorteil! |
|
|
| |
|
|
|
Julian Schmidt | Der Ver código fuente con wm_ncHitTest funktioniert wirklich super! Gracias Andreas
$H Windows.ph
$H Messages.ph
$H Structs.ph
STRUCT TRect = ~Rect
STRUCT TPoint = ~Punto
Proc HitTest
Parámetros hCtl&,lParam&
Declarar Punto#
Declarar Rect#
Dim Punto#,TPoint
Dim Rect#,TRect
Punto#.x& = LoWord(lParam&)
Punto#.y& = HiWord(lParam&)
~ScreenToClient(hCtl&,Punto#)
~GetWindowRect(hCtl&,Rect#)
~MapWindowPoints(~GetDesktopWindow(),%Hwnd,Rect#,2)
If (Punto#.y& < 4) AND (Punto#.x& < 4)
Disponer Punto#,Rect#
Volver ~HTTOPLEFT
ElseIf (Punto#.y& < 4) AND (Punto#.x& >= (Rect#.right& - Rect#.left&-4))
Disponer Punto#,Rect#
Volver ~HTTOPRIGHT
ElseIf (Punto#.y& >= (Rect#.bottom& - Rect#.top&-4)) AND (Punto#.x& >= (Rect#.right& - Rect#.left&-4))
Disponer Punto#,Rect#
Volver ~HTBOTTOMRIGHT
ElseIf (Punto#.x& < 4) AND (Punto#.y& >= (Rect#.bottom& - Rect#.top& - 4))
Disponer Punto#,Rect#
Volver ~HTBOTTOMLEFT
ElseIf Punto#.y& < 4
Disponer Punto#,Rect#
Volver ~HTTOP
ElseIf Punto#.x& < 4
Disponer Punto#,Rect#
Volver ~HTLEFT
ElseIf Punto#.x& >= (Rect#.right& - Rect#.left& - 4)
Disponer Punto#,Rect#
Volver ~HTRIGHT
ElseIf Punto#.y& >= (Rect#.bottom& - Rect#.top& - 4)
Disponer Punto#,Rect#
Volver ~HTBOTTOM
Más
Disponer Punto#,Rect#
Volver ~HTCAPTION
EndIf
ENDPROC
SubClassProc
If SubClassMessage(&sWnd,~WM_NCHITTEST)
Conjunto("WinProc", 0)
Volver HitTest(&swnd,&slParam)
Endif
ENDPROC
windowstyle 2+16+64
window 600,400
cls 255
var dg&=Crear("Window",%hwnd,"",10,10,200,100)
StartPaint dg&
cls 255
EndPaint
SubClass dg&,1
SubClass %hwnd,1
mientras que 1
waitinput 30
caso iskey(27) : end
endwhile
|
|
|
| |
|
|
|
Jörg Sellmeyer | Na - si el no Rolf para seinen ROC gebrauchen kann, weiß ich's auch no. Irgendwer woltte doch auch veces Edits skalieren. Man hier zwar no reinschreiben aber para una Entwurfsmodus es el doch großartig!! |
|
|
| Windows XP SP2 XProfan X4... und hier mal was ganz anderes als Profan ... | 23.09.2011 ▲ |
|
|
|
|
| Vlt. todavía nen Verschieben con einbauen. |
|
|
| |
|
|
|
Jörg Sellmeyer | |
|
| Windows XP SP2 XProfan X4... und hier mal was ganz anderes als Profan ... | 23.09.2011 ▲ |
|
|
|
|
| Ah, determinado wegen más HTCAPTION. |
|
|
| |
|
|
|
Jörg Sellmeyer | Kann al así einrichten, daß lo con Statics ebenfalls funktioniert? |
|
|
| Windows XP SP2 XProfan X4... und hier mal was ganz anderes als Profan ... | 11.11.2011 ▲ |
|
|
|
|
| Von Andreas su Variante por wm_ncHitTest weiß Yo no aber con "meiner" analogeren Variante ginge lo auch con unsichtbaren Controls: [...] |
|
|
| |
|
|
| |
|
- Página 3 - |
|
|
Jörg Sellmeyer | Was media Usted con unsichtbaren Controls? Irgendwie mag Yo el Variante de Andreas mehr, obwohl Su auch interessant es. El de Andreas scheint me systemnäher. |
|
|
| Windows XP SP2 XProfan X4... und hier mal was ganz anderes als Profan ... | 11.11.2011 ▲ |
|
|
|
|
| Andreas seine es ya que de Sistema pensamiento es y "meine" Variante es más una analoge Selbermachvariante.
Beide Varianten haben ihre Vor- y Nachteile. En "meiner" Variante ha uno mehr Eingriffsmöglichkeiten y kann auch Verschiebungen ermöglichen el vom Sistema eben no "gedacht" son. Wer also Controls como vom Sistema pensamiento mover möchte nimmt wm_ncHitTest y para Spezialitäten sólo el analogere Variante. |
|
|
| |
|
|