English
Forum

Moving Objects

 
- Page 1 -



Thomas
Freier
Help, new problem and I did not come.

If I want to edit a vertical text, remaining the EDIT only receive, if the Right is the word beginning or The Mouse button held and the Curser in that EDIT pulled becomes. How can the fixed go?
CompileMarkSeparation
DEF GetSysColor(1) !"USER32","GetSysColor"
Def WindowFromPoint(2)!"USER32","WindowFromPoint"
Def GetCursorPos(1) !"USER32","GetCursorPos"
Declare p#,h&
Dim p#,8
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Def GetTextExtentPoint32(4) !"GDI32","GetTextExtentPoint32A"
Def ReleaseDC(2) !"USER32","ReleaseDC"
Def GetDC(1) !"USER32","GetDC"
declare x%,y%

Proc GetTextExtent

    Parameters _t$,_w%
    declare _size#,_text#,_result&,_hdc&
    dim _text#,Len(_t$) + 1
    dim _size#,8
    String _text#,0 = _t$
    _hdc& = GetDC(GetActiveWindow())
    GetTextExtentPoint32(_hdc&,_text#,Len(_t$),_size#)
    _result& = Long(_size#,4)
    Case _w% : _result& = Long(_size#,0)
    ReleaseDC(GetActiveWindow(),_hdc&)
    dispose _text#
    dispose _size#
    return _result&

EndProc

'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Def @Clienttoscreen(2) !"USER32","ClientToScreen"
Def @G2lx(0) @Long(C2sstrc#,0)
Def @G2ly(0) @Long(C2sstrc#,4)

Proc G2l

    Parameters Hdl&
    Clear C2sstrc#
    @Clienttoscreen(%Hwnd,C2sstrc#)
    x%=@G2lx()
    y%=@G2ly()
    Clear C2sstrc#
    @Clienttoscreen(Hdl&,C2sstrc#)
    x%=@G2lx()-x%
    y%=@G2ly()-y%

Endproc

Declare C2sstrc#
Dim C2sstrc#,8
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

SubClassProc

    case  SubClassMessage(h&, $201):    PostMessage(h&, $A1, $2, 0)

Endproc

'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Window 1000,600
WindowTitle "Objekte bewegen"
UseFont "Arial",16,0,0,0,0
var LV_Font&=CreateFont("Arial",15,0,0,0,0)
SETDIALOGFONT LV_Font&
Declare b.obj&[],b.x%[],b.x1%[],b.y%[],b.y1%[], b.text$[],b.lage$[]
Declare b.xn%
Declare pic1&
DrawPic "Hemmelsdorf.png",0,0;0
DrawText 10,10,"Verschieben nach Doppelklick links; " +
"NEU (Ändern) : Rechtsklick freie Fläche (Text)....  mit RETURN oder Klick ins Fenster übernehmen."
b.xn%=1
b.x%[b.xn%]=720
b.y%[b.xn%]=140
b.text$[b.xn%]="K. Mustermann"
b.lage$[b.xn%]="W"
Boot_obj b.xn%
Subclass b.obj&[b.xn%],1
b.xn%=2
b.x%[b.xn%]=448
b.y%[b.xn%]=320
b.text$[b.xn%]="E. Wassermann"
b.lage$[b.xn%]="S"
Boot_obj b.xn%
Subclass b.obj&[b.xn%],1
b.xn%=2

While 1

    WaitInput
    Case %key=2:Break

    Whileloop b.xn%

        G2l b.obj&[&loop]
        b.x%[&loop]=x%
        b.y%[&loop]=y%

    EndWhile

    GetCursorPos(p#)
    h&=WindowFromPoint(Long(p#,0),Long(p#,4))
    Locate 0,0

    if %MouseKey=2

        x%=1

        Whileloop b.xn%' Anzahl der Objekte

            if Mouse(b.x%[&loop],b.y%[&loop] - (b.x%[&loop]+b.x1%[&loop]),(b.y%[&loop]+b.y1%[&loop]))

                ShowWindow(b.obj&[&loop],0)
                Element_Edit  &loop' EDIT-Feld
                Subclass b.obj&[&loop],1
                x%=0
                break

            endif

        wend

        if x%=1

            inc b.xn%
            b.x%[b.xn%]=%MouseX
            b.y%[b.xn%]=%MouseY
            b.text$[b.xn%]=""
            b.lage$[b.xn%]="W"
            Element_Edit b.xn%
            Subclass b.obj&[b.xn%],1

        endif

    endif

    SetFocus(%HWND)

EndWhile

DeleteObject LV_Font&
DeleteObject pic1&

Whileloop b.xn%

    Subclass b.obj&[&loop],0

EndWhile

Dispose C2sstrc#
Dispose p#
End

Proc Boot_obj

    Parameters b.xi%
    UseFont "Arial",(16+2),0,0,0,0
    GetTextExtent b.text$[b.xi%],1'Textlänge
    b.x1%[b.xi%] = &(0)+0'Länge
    GetTextExtent b.text$[b.xi%],0
    b.y1%[b.xi%] = &(0)+4'Höhe

    If trim$(b.lage$[b.xi%]="S")'Länge+Höhe tauschen bei senkrecht

        x%=b.y1%[b.xi%]
        b.y1%[b.xi%]=b.x1%[b.xi%]
        b.x1%[b.xi%]=x%

    endif

    MCls b.x1%[b.xi%], b.y1%[b.xi%] ,RGB(255,255,255)
    StartPaint -1
    TextColor @RGB(0,0,160), -1

    If trim$(b.lage$[b.xi%]="W")

        Set("Orientation", 0)
        UseFont "Arial",16,0,0,0,0
        DrawText 0, 2, b.text$[b.xi%]

    ElseIf trim$(b.lage$[b.xi%]="S")

        Set("Orientation", 2700)
        UseFont "Arial",(16-1),0,0,0,0
        DrawText b.x1%[b.xi%]-2, 0, b.text$[b.xi%]

    Endif

    Endpaint
    Set("Orientation", 0)
    pic1&=Create("hPic",0,"&MEMBMP" )
    b.obj&[b.xi%]=Control("DIALOG","",$54001100,b.x%[b.xi%], b.y%[b.xi%], b.x1%[b.xi%], b.y1%[b.xi%],%hwnd,0,%hinstance,$0)
    Create("Bitmap",b.obj&[b.xi%], pic1&,0, 0)

Endproc

Proc Element_Edit

    Parameters b.xi%
    var Element&= CreateEdit(%hwnd,b.text$[b.xi%],b.x%[b.xi%], b.y%[b.xi%], 120, 22)
    SetFont Element&,LV_Font&
    var Element1&=Create("GroupBox",%hwnd,"",(b.x%[b.xi%]+124), (b.y%[b.xi%]-8),80,30)
    CreateText(Element1&,"",2,10,76,18)
    var hor&=Create("RadioButton",%hwnd,"",(b.x%[b.xi%]+126),(b.y%[b.xi%]+5),12,12)
    var t1&=CreateText(Element1&,"0°",18,11,14,16)
    var sen&=Create("RadioButton",%hwnd,"",(b.x%[b.xi%]+166),(b.y%[b.xi%]+5),12,12)
    var t2&=CreateText(Element1&,"90°",56,11,22,16)
    SetFont hor&,LV_Font&
    SetFont t1&,LV_Font&
    SetFont t2&,LV_Font&

    If trim$(b.lage$[b.xi%]="W")

        SetCheck hor&,1

    else

        SetCheck sen&,1

    EndIf

    Setfocus(Element&)
    SendString(Element&,"+({END})")'Text Markieren und Cursor ans Ende
    Setfocus(Element&)

    While 1

        GetMessage

        If GetFocus(%hwnd)

            b.text$[b.xi%] = GetText$(Element&)

            If GetCheck(hor&)

                b.lage$[b.xi%]="W"

            Else

                b.lage$[b.xi%]="S"

            EndIf

            BREAK

        Elseif IsKey(13) OR IsKey(27)

            b.text$[b.xi%] = GetText$(Element&)

            If GetCheck(hor&)

                b.lage$[b.xi%]="W"

            Else

                b.lage$[b.xi%]="S"

            EndIf

            BREAK

        endif

    wend

    DestroyWindow(Element&)
    DestroyWindow(Element1&)
    DestroyWindow(hor&)
    oyWindow(sen&)
    Boot_obj b.xi%' Textobjekt new

ENDPROC


35 kB
Hochgeladen:07/03/10
Downloadcounter184
Download
 
Gruß Thomas
Windows XP SP2, XProfan X2
07/02/10  
 



 
- Page 1 -



Jörg
Sellmeyer
is very calm (except for The fact, that I through your Sourcecode again not durchsteige...)
mandatory I me time of XPSE translate let. can You do not the Community a option give liberally, that XPSE-code to Profan Translated becomes?

Double-clicking on an object there incidentally a crash. though first, after I it moved have.
 
Windows XP SP2 XProfan X4
... und hier mal was ganz anderes als Profan ...
07/21/10  
 



Related to the Double click is correctly., there missing one if objekt= of type Text - View source should only moreover expanded go.

>> Profan Translated becomes

Nimm whom code still Please How he's, which place is because unverständlich?
 
07/21/10  
 




Jörg
Sellmeyer
is already ok - I Have none dran virtual, that Profan Yes now too variables without Postfix knows.
 
Windows XP SP2 XProfan X4
... und hier mal was ganz anderes als Profan ...
07/21/10  
 




Thomas
Freier
Yes calm, and I had severe food Alà "iFDRW V0.0.1" expects.
I can with the korell.exe no Moving Objects. the Cross appear, but no further reaction.
The Abstürze once außeracht let.
If ego had implemented Profancode, I take the next week before or on vacation, if no Laxe rising water temperatures in these.
 
Gruß Thomas
Windows XP SP2, XProfan X2
07/22/10  
 



Hello Thomas,

if it with you crashes - except with Double-click on something other as Text - then would I first The Bug find want.

likewise should the Objects with the mouse can move easily.

If the with you not working, then know I gladly, and so or. what very there schief runs.

>> If ichs in the Profancode umgesetzt have,

really wished I you work take off and having you thatswhy whom Text gepinselt. ^^..
 
07/22/10  
 



 
- Page 2 -



Thomas
Freier
Hello iF,
the "Neubau" has us Yes on this place interrupted.
means, with the Koroll.exe can I only new Objects create but no moving (gif).
means, script attempts to start and there whom XProfan Compiler through XPSE supplant. is the correctly.?. unfortunately matching The Message: "Definition in the Header missing: GETSCROLLPOS(" .
here then to XPSE sought and not found. How mach I means moreover?

158 kB
Hochgeladen:08/06/10
Downloadcounter118
Download
 
Gruß Thomas
Windows XP SP2, XProfan X2
08/06/10  
 



> means, with the Koroll.exe can I only new Objects create but no moving (gif).

You can Objects simply by Mouse button touch and move - has yet on none of my computer not functions. ought to the with you not functions then läge me absolutely something on it to know what with you schief runs. The Objects can also animiert his - The Engine discretionary To strain bid I you gladly on. (me but momentarily toe quite wehtut)

> means, script attempts to start and there whom XProfan Compiler through XPSE supplant. is the correctly.?

On none drop!

one copies xpse simply in that XProfanverzeichnis where too z.B. The profane.exe and XProfan-Compiler lying and the IDE gives one XPSE as Compiler on or one position it as tool one. appeal integrally normal xpse.exe quelltext.File. From XProfan supplant becomes there nothing and nothing überschrieben, XPSE gives still its verrichtetet work on whom XProfan-Compiler moreover and so this not are missing must. (what XPSE but too anmeckert if no XProfan-Compiler found...)
 
08/09/10  
 



Nachtrag of Handy ausm bed hehe: xpse has its solid address under  [...]  and is too with whom Helfern to find.
 
08/09/10  
 




Thomas
Freier
iF, first once slippy Recovery.
Moving Objects is of of my Page on the autumn vertagt. has means Time!
will be it moreover testing as comes. I can on my Laptops with XP SP2 no Objekt move. it comes the Curserkreuz, the Objekt has whom Focus and the war's. Merkwürdiger point have I XP Tablet no Abstürze. there can I zigmal Objects enable and tempt To move, new lay out, Text change and delete.
really are your programs still neutral. here understand I The PC-world not any more.
XPSE I had zwischenzeitlich found and the latest Version into XProfan11 - Ordner copies.
 
Gruß Thomas
Windows XP SP2, XProfan X2
08/10/10  
 



>> iF, first once slippy Recovery.

thanks, need I really.

>> I can on my Laptops with XP SP2 no Objekt move.

understand and queer, having it on XP SP2 program - whom Error find we but certainly.

>> it comes the Curserkreuz, the Objekt has whom Focus and the war's.

Schonmal well because the "Focus" likewise painted is.

>> Merkwürdiger point have I XP Tablet no Abstürze.
>> really are your programs still neutral. here understand I The PC-world not any more.

there wären 2 items The I me so in the back of the head as vlt. "verantwortlich" comment - if I my Programmier-PC again under whom Fingern have can we vlt. testing.
 
08/10/10  
 




Thomas
Freier
iF, the has Time. be ohnehin now some weeks without internet on nördlicheren Spielwiesen:  [...]  and  [...]  .
And if You with your Luna-Mobil game, be nächstes time vorsichtiger or ziehe Sicherheitsschuhe on.
 
Gruß Thomas
Windows XP SP2, XProfan X2
08/10/10  
 



thanks!
 
08/10/10  
 




Answer


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

13.687 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