English
Forum

Done: out at update

 

Manfred
Barei
Hi,

i hope so can me of/ one help, Maybe even Stefan quick.
(Try with your code RichEdit: Cursor inquire)

I Try and Try and get it simply not there , It's all right therefore, in the Statuszeile should
The display the Lines and Spaltenanzahl ongoing updated go if I in the Editorfeld Inputs make. have already some probiert however works it only if I on the Butten (Cursor-position) Clicke.
See code:
CompileMarkSeparation
 $P+
SET("ERRORLEVEL",0)
DEF GETSYSCOLOR(1) !"USER32","GetSysColor"
-Header-Dateien------------------------------------------------------
 $H Windows.ph
 $H RichEdit.ph
 $H Structs.ph
 $H Messages.ph
-Strukturen----------------------------------------------------------
DECLARE RICHEDIT1&
DECLARE BUTTON1&
DECLARE BUTTON2&
Declare CharRange#
Struct CharRange = ~CHARRANGE
Dim CharRange#, CharRange
-Funktion GetCursorPosX (Spalte)-------------------------------------

Proc GetCursorPosX

    SendMessage(RICHEDIT1&, ~EM_EXGETSEL, 0, CharRange#)
    Return Int(CharRange#.cpMax& - (SendMessage(RICHEDIT1&,
    ~EM_LINEINDEX, SendMessage(RICHEDIT1&, ~EM_EXLINEFROMCHAR, 0,
    CharRange#.cpMin&), 0)) + 1)

EndProc

-Funktion GetCursorPosY (Zeile)--------------------------------------

Proc GetCursorPosY

    SendMessage(RICHEDIT1&, ~EM_EXGETSEL, 0, CharRange#)
    Return Int(SendMessage(RICHEDIT1&, ~EM_EXLINEFROMCHAR, 0,
    CharRange#.cpMin&) + 1)

EndProc

Proc position

    SetText Sz&, 0, " Zeile: " + @Str$(GetCursorPosY())
    SetText Sz&, 1, " Spalte: " + @Str$(GetCursorPosX())

EndProc

WINDOWSTYLE 539
WINDOWTITLE "Test"
WINDOW (%maxx/2 - 280/2),(%maxy/2 - 320/2) - 280,320
SET("TRUECOLOR",1)
DECLARE ENDE%
CLS GETSYSCOLOR(15)
USEFONT "MS Sans Serif",13,0,0,0,0
SETDIALOGFONT 1
Hier kann ggf. Ihr Menü hin
RICHEDIT1& = CREATE("RICHEDIT",%HWND,"",0015,0015,0245,0175)
BUTTON1& = CREATE("BUTTON",%HWND,"Cursor Position",0020,0215,0100,0030)
BUTTON2& = CREATE("BUTTON",%HWND,"Prog. Ende",0150,0215,0100,0030)
-----------------------------Statuszeile------------------------------
Declare L#,Sz&
Dim L#, 12                                   Long-Bereich für 3 Felder (3 * 4 Bytes)
Long L#,0 = 75, 195, -1                     Maße der einzelnen Statusfelder
Sz& = @Create("StatusWindow",%HWND,"",3,L#)  StatusWindow erzeugen
SetText Sz&, 0, " Zeile:"                       Feld1 mit Text bestücken
SetText Sz&, 1, " Spalte:"                          Feld2 mit Text bestücken
SetText Sz&, 2, Date$(0)                     Feld3 mit Text bestücken
---------------------------------------------------------------------
SETFOCUS(%HWND)
REPAINT

WHILENOT ENDE%

    WAITINPUT

    If %KEY=2

        ENDE% = 1

    ELSEIF %KEY=4

        SETWINDOWPOS Sz& = 0,0 - 0,0;0

    ELSEIF CLICKED(RICHEDIT1&) RICHEDIT

    ELSEIF CLICKED(BUTTON1&) BUTTON Cursor Position

        position

    ELSEIF CLICKED(BUTTON2&) BUTTON Prog. Ende

        ENDE% = 1

    ENDIF

    position

ENDWHILE

End

Greeting Manfred
 
Zu wenig Wissen ist gefärlich, zu viel auch.(XProfan X4) | Win 10 Pro 64 | Win7 Ultimate 32/64 | AMD FX-8320, 16GB, GeForce GT 630 |
03/21/10  
 




Thomas
Freier
can you with GetMessage life instead of WAITINPUT?
or by SubProc.
 
Gruß Thomas
Windows XP SP2, XProfan X2
03/21/10  
 




Detlef
Jagolski
Hi,

Teste the time.
CompileMarkSeparation
 $P+
SET("ERRORLEVEL",0)
DEF GETSYSCOLOR(1) !"USER32","GetSysColor"
-Header-Dateien------------------------------------------------------
 $H Windows.ph
 $H RichEdit.ph
 $H Structs.ph
 $H Messages.ph
-Strukturen----------------------------------------------------------
DECLARE RICHEDIT1&
DECLARE BUTTON1&
DECLARE BUTTON2&
Declare CharRange#
Struct CharRange = ~CHARRANGE
Dim CharRange#, CharRange
-Funktion GetCursorPosX (Spalte)-------------------------------------

SubClassProc

    If SubClassMessage(RICHEDIT1&, ~WM_CHAR)

        position

    EndIf

EndProc

Proc GetCursorPosX

    SendMessage(RICHEDIT1&, ~EM_EXGETSEL, 0, CharRange#)
    Return Int(CharRange#.cpMax& - (SendMessage(RICHEDIT1&,
    ~EM_LINEINDEX, SendMessage(RICHEDIT1&, ~EM_EXLINEFROMCHAR, 0,
    CharRange#.cpMin&), 0)) + 1)

EndProc

-Funktion GetCursorPosY (Zeile)--------------------------------------

Proc GetCursorPosY

    SendMessage(RICHEDIT1&, ~EM_EXGETSEL, 0, CharRange#)
    Return Int(SendMessage(RICHEDIT1&, ~EM_EXLINEFROMCHAR, 0,
    CharRange#.cpMin&) + 1)

EndProc

Proc position

    SetText Sz&, 0, " Zeile: " + @Str$(GetCursorPosY())
    SetText Sz&, 1, " Spalte: " + @Str$(GetCursorPosX())

EndProc

WINDOWSTYLE 539
WINDOWTITLE "Test"
WINDOW (%maxx/2 - 280/2),(%maxy/2 - 320/2) - 280,320
SET("TRUECOLOR",1)
DECLARE ENDE%
CLS GETSYSCOLOR(15)
USEFONT "MS Sans Serif",13,0,0,0,0
SETDIALOGFONT 1
Hier kann ggf. Ihr Menü hin
RICHEDIT1& = CREATE("RICHEDIT",%HWND,"",0015,0015,0245,0175)
BUTTON1& = CREATE("BUTTON",%HWND,"Cursor Position",0020,0215,0100,0030)
BUTTON2& = CREATE("BUTTON",%HWND,"Prog. Ende",0150,0215,0100,0030)
-----------------------------Statuszeile------------------------------
Declare L#,Sz&
Dim L#, 12 Long-Bereich für 3 Felder (3 * 4 Bytes)
Long L#,0 = 75, 195, -1 Maße der einzelnen Statusfelder
Sz& = @Create("StatusWindow",%HWND,"",3,L#) StatusWindow erzeugen
SetText Sz&, 0, " Zeile:" Feld1 mit Text bestücken
SetText Sz&, 1, " Spalte:" Feld2 mit Text bestücken
SetText Sz&, 2, Date$(0) Feld3 mit Text bestücken
---------------------------------------------------------------------
SETFOCUS(%HWND)
REPAINT
SubClass RICHEDIT1&,1

WHILENOT ENDE%

    WAITINPUT

    If %KEY=2

        ENDE% = 1

    ELSEIF %KEY=4

        SETWINDOWPOS Sz& = 0,0 - 0,0;0

    ELSEIF CLICKED(RICHEDIT1&)RICHEDIT

    ELSEIF CLICKED(BUTTON1&)BUTTON Cursor Position

        position

    ELSEIF CLICKED(BUTTON2&)BUTTON Prog. Ende

        ENDE% = 1

    ENDIF

    position

ENDWHILE

Dispose CharRange#
SubClas
RICHEDIT1&,0 End
 
XProfan X4, PRFellow, Profan2Cpp - Version 2.0c-pre5, Windows 11
03/21/10  
 




Manfred
Barei
thanks Detlef, so functions it.

Greeting Manfred
 
Zu wenig Wissen ist gefärlich, zu viel auch.(XProfan X4) | Win 10 Pro 64 | Win7 Ultimate 32/64 | AMD FX-8320, 16GB, GeForce GT 630 |
03/21/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

1.181 Views

Untitledvor 0 min.
Frank Vorholzer04/20/11

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