English
Forum

Skalierbares-Window create, without fat welt

 
- Page 1 -



Julian
Schmidt
Hi,
i'd gladly from optischen Found one Window create the furthermore skalierbar is, though none fat welt own. is such a thing possible?

LG

Julian57
 
XProfan X2
Win7 Home Premium, SP1, AMD Athlon(tm) II Neo K125 Processor

˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗
Webseite [...] 
09/20/11  
 



« this Posting watts as Solution marked. »


Andreas
Miethe


iF (21.09.11)
you have already a fat block: case (%mouseXheight(%hWnd)-10) : hwnd.scaleByMouse()


iF (21.09.11)
there can You still the hWnd.scaleByMouse-Proc as Parameter transfer which corner/ edge meant was in order to Ersparen the You, the in Proc first again detect must.


the goes me somehow against whom Strich

This will usually over The Message WM_NCHITTEST geregelt.

here time one small example for a skalier / verschiebbaren Button. ought to itself well for a Window adjust let.
 $H windows.ph
 $H Messages.ph
 $H Structs.ph
STRUCT TRect         = ~Rect
STRUCT TPoint        = ~Point

Proc HitTest

    Parameters hCtl&,lParam&
    Declare Point#
    Declare Rect#
    Dim Point#,TPoint
    Dim Rect#,TRect
    Point#.x& = LoWord(lParam&)
    Point#.y& = HiWord(lParam&)
    ~ScreenToClient(hCtl&,Point#)
    ~GetWindowRect(hCtl&,Rect#)
    ~MapWindowPoints(~GetDesktopWindow(),%Hwnd,Rect#,2)

    If (Point#.y& < 4) AND (Point#.x& < 4)

        Dispose Point#,Rect#
        Return  ~HTTOPLEFT

    ElseIf (Point#.y& < 4) AND (Point#.x& >= (Rect#.right& - Rect#.left&-4))

        Dispose Point#,Rect#
        Return  ~HTTOPRIGHT

    ElseIf (Point#.y& >= (Rect#.bottom& - Rect#.top&-4)) AND (Point#.x& >= (Rect#.right& - Rect#.left&-4))

        Dispose Point#,Rect#
        Return  ~HTBOTTOMRIGHT

    ElseIf (Point#.x& < 4) AND (Point#.y& >= (Rect#.bottom& - Rect#.top& - 4))

        Dispose Point#,Rect#
        Return  ~HTBOTTOMLEFT

    ElseIf Point#.y& < 4

        Dispose Point#,Rect#
        Return  ~HTTOP

    ElseIf Point#.x& < 4

        Dispose Point#,Rect#
        Return ~HTLEFT

    ElseIf Point#.x& >= (Rect#.right& - Rect#.left& - 4)

        Dispose Point#,Rect#
        Return ~HTRIGHT

    ElseIf Point#.y& >= (Rect#.bottom& - Rect#.top& - 4)

        Dispose Point#,Rect#
        Return ~HTBOTTOM

    Else

        Dispose Point#,Rect#
        Return ~HTCAPTION

    EndIf

ENDPROC

SubClassProc

    If SubClassMessage(&sWnd,~WM_NCHITTEST)

        Set("WinProc", 0)
        Return HitTest(&swnd,&slParam)

    Endif

ENDPROC

cls
Var Ende& = 0
Var Button& = Create("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 :  [...] 
09/21/11  
 



Yes naturally and there there many ways -

beget z.B. simply one Window the none fat welt own and respond in the subClassProc on wm_mouseMove on richtiger position circa with wm_setCursor around the Mauspfeil optisch anzupassen and with wm_lButtonDown save in Global actually wide and Höhe and Mausposition and a IchSkaliereGrad-Flag and additional with wm_mouseMove if IchSkaliereGrad-Flag staid is simply by setWindowPos The FensterGröße adjust.
 
09/20/11  
 




Julian
Schmidt
iF (20.09.11)
beget z.B. simply one Window the none fat welt own and respond in the subClassProc on wm_mouseMove on richtiger position circa with wm_setCursor around the Mauspfeil optisch anzupassen and with wm_lButtonDown save in Global actually wide and Höhe and Mausposition and a IchSkaliereGrad-Flag and additional with wm_mouseMove if IchSkaliereGrad-Flag staid is simply by setWindowPos The FensterGröße adjust.


hears itself everything else as simply on.
have you got so what already made and vlt a View source parat?
 
XProfan X2
Win7 Home Premium, SP1, AMD Athlon(tm) II Neo K125 Processor

˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗
Webseite [...] 
09/20/11  
 



No I have moreover nothing parat but an example for writes itself almost of self:
/*
{$cleq}
{$compiler c:\XProfan11\}
{$runtime c:\XProfan11\}
*/
windowstyle 1 | 2 | 8 | 16 | 512
window 640,480
userMessages 16,513,20//wm_close,wm_lButtonDown,wm_eraseBkGnd
subClass %hWnd,1

while 1

    waitInput

    select %uMessage

        caseof 16 : break

        caseof 513

        case (%mouseX>width(%hWnd)-10) and (%mouseY>height(%hWnd)-10) : hWnd.scaleByMouse()

    endSelect

wend

end

subClassProc

    case subClassMessage(%hWnd, 512):useCursor (%mouseX>width(%hWnd)-10) and (%mouseY>height(%hWnd)-10)*7//wm_mouseMove

endProc

proc hWnd.scaleByMouse

    declare 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

    while isKey(1)

        waitInput 10
        external("user32","GetCursorPos",m#)
        setWindowPos %hWnd=%winLeft,%winTop - wi&-omx%+long(m#,0),he&-omy%+long(m#,4)

    wend

    dispose m#

endProc

an XPSE-Variante:

with this example have You related the Mainwindow under right a Greifpunkt.
 
09/20/11  
 




Julian
Schmidt
Can these Greifpunkte on any corners, pages transfer?
 
XProfan X2
Win7 Home Premium, SP1, AMD Athlon(tm) II Neo K125 Processor

˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗
Webseite [...] 
09/20/11  
 



You can still by code so many corners and Kanten define How You like and on Murmelei react. oO
 
09/20/11  
 




Julian
Schmidt
Öhm...Yes
only I get with the whom Cursors not geregelt.

what's this thing for a komische structure in the SubclassProc?
useCursor (%mouseX>width(%hWnd)-10) and (%mouseY>height(%hWnd)-10)*7

The normalen Parameter for UseCursor see still differently from!?
windowstyle 1 | 2 | 8 | 16 | 512 | 64
window 640,480
cls RGB(255,0,0)
userMessages 16,513,20
subClass %hWnd,1

while 1

    waitInput

    select %uMessage

        caseof 16 : break

        caseof 513

        case (%mouseX>width(%hWnd)-10) and (%mouseY>height(%hWnd)-10) : hwnd.scaleByMouse()
        case (%mouseX<10) and (%mouseY<10) : hwnd.scaleByMouse()
        case (%mouseX>width(%hWnd)-10): hwnd.scaleByMouse()
        case (%mouseY>height(%hWnd)-10) : hwnd.scaleByMouse()
        case (%mouseX<10) : hwnd.scaleByMouse()
        case (%mouseY<10) : hwnd.scaleByMouse()

    endSelect

    case iskey(27) : end

wend

end

subClassProc

    case subClassMessage(%hWnd, 512): case (%mouseX>width(%hWnd)-10) and (%mouseY>height(%hWnd)-10): UseCursor 7//wm_mouseMove
    case subClassMessage(%hWnd, 512): case (%mouseX<10) and (%mouseY<10): UseCursor 9//wm_mouseMove

endProc

proc hwnd.scaleByMouse

    declare 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

    while isKey(1)

        waitInput 10
        external("user32","GetCursorPos",m#)
        setWindowPos %hWnd=%winLeft,%winTop - if(wi&-omx%+long(m#,0)>0,wi&-omx%+long(m#,0),10),if(he&-omy%+long(m#,4)>0,he&-omy%+long(m#,4),10)

    wend

    dispose m#

endProc

 
XProfan X2
Win7 Home Premium, SP1, AMD Athlon(tm) II Neo K125 Processor

˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗
Webseite [...] 
09/20/11  
 



... but too only because You it even not regelst.

You definierst z.B. not useCursor 0 in the drop the even no Sondercursor viewed go should.

These from you as "komisch" and as "Konstruktion" designated instruction sees this but to:

because if the argument false is becomes useCursor 0 dependent instead of 7.

whom code on any corners and Kanten umzustellen is pure Fleißarbeit -

I wished you Yes only show a) the and b) How one it employ could.
 
09/21/11  
 




Julian
Schmidt
was nevertheless a komische structure. ^^
but now is me too clear as funktionierte.
either throws
(%mouseX>width(%hWnd)-10) and (%mouseY>height(%hWnd)-10)
1 or 0 back.
accordingly: 0*7=0 & 1*7=7

meanwhile is with the the Cursors everything geregelt.
I find only yet a Bug in whom Snippet and of course the Skalieren from the left-Oberen corner.
Also can the window with 2 corners,Kanten on a Size of 0px wander, which I simply not rausbekomme. can who help?
windowstyle 1 | 2 | 8 | 16 | 512 | 64
window 600,400
cls RGB(255,0,0)
userMessages 16,513,20
subClass %hWnd,1

while 1

    waitInput

    select %uMessage

        caseof 16 : break

        caseof 513

        case (%mouseX<10) and (%mouseY<10) : hwnd.scaleByMouse()'corners
        case (%mouseX>width(%hWnd)-10) and (%mouseY<10) : hwnd.scaleByMouse()
        case (%mouseX<10) and (%mouseY>height(%hWnd)-10) : hwnd.scaleByMouse()
        case (%mouseX>width(%hWnd)-10) and (%mouseY>height(%hWnd)-10) : hwnd.scaleByMouse()
        case (%mouseX<10) : hwnd.scaleByMouse()'Kanten
        case (%mouseY<10) : hwnd.scaleByMouse()
        case (%mouseX>width(%hWnd)-10) : hwnd.scaleByMouse()
        case (%mouseY>height(%hWnd)-10) : hwnd.scaleByMouse()

    endSelect

    case iskey(27) : end

Endwhile

end

subClassProc

    if subClassMessage(%hWnd, 512)

        if ((%mouseX<10) and (%mouseY<10)) or ((%mouseX>width(%hWnd)-10) and (%mouseY>height(%hWnd)-10))

            UseCursor 7

        elseif ((%mouseX<10) and (%mouseY>height(%hWnd)-10)) or ((%mouseX>width(%hWnd)-10) and (%mouseY>height(%hWnd)-10))

            UseCursor 8

        elseif (%mouseX<10) or (%mouseX>width(%hWnd)-10)

            UseCursor 9

        elseif (%mouseY<10) or (%mouseY>height(%hWnd)-10)

            UseCursor 10

        else

            UseCursor 0

        Endif

    Endif

endProc

proc hwnd.scaleByMouse

    declare 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
    var wleft&=%winleft
    var wtop&=%winTop

    while isKey(1)

        waitInput 10
        external("user32","GetCursorPos",m#)
        case (omx%>%winLeft) and (omy%>%winTop) : setWindowPos %hWnd=%winLeft,%winTop - if(wi&-omx%+long(m#,0)>10,wi&-omx%+long(m#,0),10),if(he&-omy%+long(m#,4)>10,he&-omy%+long(m#,4),10)
        case (omx%<%winLeft+10) : setWindowPos %hWnd=long(m#,0),%winTop,(wleft&+wi&)-long(m#,0),he&
        case (omy%<%winTop+10) : setWindowPos %hWnd=%winLeft,long(m#,4),wi&,(wtop&+he&)-long(m#,4)

    Endwhile

    dispose m#

endProc

 
XProfan X2
Win7 Home Premium, SP1, AMD Athlon(tm) II Neo K125 Processor

˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗
Webseite [...] 
09/21/11  
 



you have already a fat block:
there can You still the hWnd.scaleByMouse-Proc as Parameter transfer which corner/ edge meant was in order to Ersparen the You, the in Proc first again detect must.
 
09/21/11  
 




Julian
Schmidt
Meinst You is then kürzer?
inquire must I it always, be it now in the Proc, or in the "fetten Block"?

Also the detect eachone edge, corner in the Proc is neither so heavy!
it flackert integrally terrible now and than at move! One Error?
windowstyle 2+16+64
window 600,400
cls RGB(255,0,0)
userMessages 16,513,20
subClass %hWnd,1

while 1

    waitInput

    select %uMessage

        caseof 16 : break

        caseof 513

        case (%mouseX<10) and (%mouseY<10) : hwnd.scaleByMouse()'corners
        case (%mouseX>width(%hWnd)-10) and (%mouseY<10) : hwnd.scaleByMouse()
        case (%mouseX<10) and (%mouseY>height(%hWnd)-10) : hwnd.scaleByMouse()
        case (%mouseX>width(%hWnd)-10) and (%mouseY>height(%hWnd)-10) : hwnd.scaleByMouse()
        case (%mouseX<10) : hwnd.scaleByMouse()'Kanten
        case (%mouseY<10) : hwnd.scaleByMouse()
        case (%mouseX>width(%hWnd)-10) : hwnd.scaleByMouse()
        case (%mouseY>height(%hWnd)-10) : hwnd.scaleByMouse()

    endSelect

    case iskey(27) : end

Endwhile

end

subClassProc

    if subClassMessage(%hWnd, 512)

        if ((%mouseX<10) and (%mouseY<10)) or ((%mouseX>width(%hWnd)-10) and (%mouseY>height(%hWnd)-10))

            UseCursor 7

        elseif ((%mouseX<10) and (%mouseY>height(%hWnd)-10)) or ((%mouseX>width(%hWnd)-10) and (%mouseY>height(%hWnd)-10))

            UseCursor 8

        elseif (%mouseX<10) or (%mouseX>width(%hWnd)-10)

            UseCursor 9

        elseif (%mouseY<10) or (%mouseY>height(%hWnd)-10)

            UseCursor 10

        else

            UseCursor 0

        Endif

    Endif

endProc

proc hwnd.scaleByMouse

    declare 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
    var wleft&=%winleft
    var wtop&=%winTop

    while isKey(1)

        waitInput 10
        external("user32","GetCursorPos",m#)
        case (omx%>%winLeft) and (omy%>%winTop) : setWindowPos %hWnd=%winLeft,%winTop - if(wi&-omx%+long(m#,0)>10,wi&-omx%+long(m#,0),10),if(he&-omy%+long(m#,4)>10,he&-omy%+long(m#,4),10)'edge under,Recht; corner right-under, right-supra
        case (omx%<%winLeft+10) and (omy%<%winTop+10) : setWindowPos %hWnd=long(m#,0),long(m#,4),(wleft&+wi&)-long(m#,0),(wtop&+he&)-long(m#,4)'corner left, supra
        case (omx%<%winLeft+10) : setWindowPos %hWnd=long(m#,0),%winTop,(wleft&+wi&)-long(m#,0),he&'edge left
        case (omy%<%winTop+10) : setWindowPos %hWnd=%winLeft,long(m#,4),wi&,(wtop&+he&)-long(m#,4)'edge supra
        case (omx%<%winLeft+10) and (omy%>%winTop+10) : setWindowPos %hWnd=long(m#,0),%winTop,(wleft&+wi&)-long(m#,0),if(he&-omy%+long(m#,4)>10,he&-omy%+long(m#,4),10)'corner left-under

    Endwhile

    dispose m#

endProc

 
XProfan X2
Win7 Home Premium, SP1, AMD Athlon(tm) II Neo K125 Processor

˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗
Webseite [...] 
09/21/11  
 




E.T.
Why must whom everything over ands over again so tricky his !!??
If I here in the Forum The Search use find I etliche Examples to Window-Scalierung, even all hereon located Elementen.

If has to a couple class things beigetragen... only one must too times the SuFu benefit, and from it self something moreover develop.

who me well too accustom, first time to Ner Solution To ask, before I me yourself whom head anstrenge...

SORRY !!!
 
XProfan X2
Grüße aus Sachsen... Mario
WinXP, Win7 (64 Bit),Win8(.1),Win10, Win 11, Profan 6 - X4, XPSE, und 'nen schwarzes, blinkendes Dingens, wo ich das alles reinschütte...
09/21/11  
 




Answer


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

28.579 Views

Themeninformationen



Admins  |  AGB  |  Applications  |  Authors  |  Chat  |  Privacy Policy  |  Download  |  Entrance  |  Help  |  Merchantportal  |  Imprint  |  Mart  |  Interfaces  |  SDK  |  Services  |  Games  |  Search  |  Support

One proposition all XProfan, The there's!


My XProfan
Private Messages
Own Storage Forum
Topics-Remember-List
Own Posts
Own Topics
Clipboard
Log off
 Deutsch English Français Español Italia
Translations

Privacy Policy


we use Cookies only as Session-Cookies because of the technical necessity and with us there no Cookies of Drittanbietern.

If you here on our Website click or navigate, stimmst You ours registration of Information in our Cookies on XProfan.Net To.

further Information To our Cookies and moreover, How You The control above keep, find You in ours nachfolgenden Datenschutzerklärung.


all rightDatenschutzerklärung
i want none Cookie