English
Source / code snippets

editor program

 

Source watts on the 15.07.2007 from the MMJ-Quellcodesammlung (Dietmar horn) in The Babyklappe on XProfan.Com stored:
editor program

proc editor

    declare _ende%
    declare _dlg%
    declare FONT%
    declare Groesse%
    declare Big%
    declare italic%
    declare underlined%
    declare CUT%
    declare COPY%
    declare INS%
    declare Text%
    declare anz!, f%, u%, k%, font$, g!, x%, File$, Text$, edit#
    def @buttonstate(1) @sendmessage(@%(1),$0F2,0,0)
    def @changed(1) @sendmessage(@%(1),$0B8,0,0)

    proc zeigeschrift

        let font$ = @GetText$(font%)
        let g! = @Mul(@Val(@GetText$(groesse%)),anz!)
        UseFont font$,g!,0,f%,k%,u%
        @sendmessage(Text%,$30,%font,1)   wm_SetFont

    endproc

    proc Datei_Laden

        let File$ = @LoadFile $(File loading:,*.txt)

        if (File$ <> )

            usecursor 2

            If (@FileSize(File$) > 32000)

                @MessageBox(File is To big for whom editor!,Info:,48)

            Else

                Dim Edit#,@FileSize(File$) + 2000
                ReadText Edit#,File$

                If @SendMessage(Text%,$000C,0,Edit#)

                    Window Title Mini-Ed 1.0 [ + File$ + ]

                Else

                    @MessageBox(File is To big for whom editor!,Info:,48)

                EndIf

                Dispose Edit#

            EndIf

            usecursor 0

        endif

    ENDPROC

    Proc save

        Parameters dname$
        Declare Nr%, Max%
        assign #1,dname$
        rewrite #1
        Let Nr% = 0
        Let Max% = @GetLineCount(Text%)

        While Nr% <= Max%

            Print #1,@GetLine$(Text%,Nr%)
            Inc Nr%

        EndWhile

        close #1

    ENDPROC

    Proc Datei_SpeichernAls

        let File$ = @SaveFile$(File Save:,File$)

        if (File$ <> )

            save File$
            Window Title Mini-Ed 1.0 [ + File$ + ]

        endif

    ENDPROC

    Proc Datei_Speichern

        If (File$ <> )

            save File$

        Else

            Datei_SpeichernAls

        EndIf

    ENDPROC

    Proc changed

        If @Changed(Text%)

            If @Equ(@MessageBox(The File watts changed. should tappt im dunkeln stored go?,

                File$,36),6)
                Datei_Speichern

            EndIf

        EndIf

    ENDPROC

    let _dlg% = %Hwnd
    let FONT%=@create(choicebox,_dlg%,,0,0,136,120)
    let Groesse%=@create(choicebox,_dlg%,,136,0,40,120)
    let Big%=@create(button,_dlg%,f,176,0,24,24)
    let italic%=@create(button,_dlg%,k,200,0,24,24)
    let underlined%=@create(button,_dlg%,u,224,0,24,24)
    let Text%=@create(multiedit,_dlg%,,0,24,548,364)
    let f% = 0
    let k% = 0
    let u% = 0
    let anz! = 1.5
    let File$ =
    clearlist
    addfonts
    @movelisttochoice(font%)
    @sendmessage(font%,$14E,2,0)
    @addchoice(groesse%,10)
    @addchoice(groesse%,12)
    @addchoice(groesse%,14)
    @addchoice(groesse%,16)
    @addchoice(groesse%,18)
    @addchoice(groesse%,22)
    @addchoice(groesse%,26)
    @sendmessage(groesse%,$14E,2,0)
    zeigeschrift
    @SetFocus(Text%)
    let _ende% = 0

    whilenot _ende%

        waitinput

        if %key = 2

            changed
            let _ende% = 1

        elseif %key = 4

            If ((%WinRight - %WinLeft) > 220) and ((%WinBottom - %WinTop) >120)

                SetWindowPos Text% = 0,24 - ((%WinRight - %WinLeft) - 6),
                ((%WinBottom - %WinTop) - 88)

            endif

        elseif @menuitem(100)

            changed
            SetText Text%,
            Let File$=
            Window Title Mini-Ed 1.5
            @SetFocus(Text%)

        elseif @menuitem(101)

            changed
            Datei_Laden
            @SetFocus(Text%)

        elseif @menuitem(102)

            Datei_Speichern
            @SetFocus(Text%)

        elseif @menuitem(103)

            Datei_SpeichernAls
            @SetFocus(Text%)

        elseif @menuitem(-3808)

            shownormal
            SetWindowPos Text% = 0,24 - ((%WinRight - %WinLeft) - 6),
            ((%WinBottom - %WinTop) - 88)

        elseif @menuitem(-4064)

            showmin

        elseif @menuitem(-4048)

            showmax
            SetWindowPos Text% = 0,24 - ((%WinRight - %WinLeft) - 6),
            ((%WinBottom - %WinTop) - 88)

        elseif @menuitem(109) or @menuitem(-4000)

            changed
            Let _ende% = 1

        elseif @menuitem(130)

            @messagebox(program with XProfan,RGH-MINITEXT,0)

        elseif @menuitem(110)

            @sendmessage(Text%,$304,0,0)   wm_Undo

        elseif @menuitem(111)

            @sendmessage(Text%,$300,0,0)   wm_Cut

        elseif @menuitem(112)

            @sendmessage(Text%,$301,0,0)   wm_Copy

        elseif @menuitem(113)

            @sendmessage(Text%,$302,0,0)   wm_Insert

        elseif @menuitem(114)

            @sendmessage(Text%,$303,0,0)   wm_Clear

        Elseif @Menuitem(200)

            let anz! = 1
            checkmenu 200,1
            checkmenu 201,0
            checkmenu 202,0
            zeigeschrift

        Elseif @Menuitem(201)

            let anz! = 1.5
            checkmenu 200,0
            checkmenu 201,1
            checkmenu 202,0
            zeigeschrift

        Elseif @Menuitem(202)

            let anz! = 2
            checkmenu 200,0
            checkmenu 201,0
            checkmenu 202,1
            zeigeschrift

        elseif @getfocus(font%)

            zeigeschrift

        elseif @getfocus(groesse%)

            zeigeschrift

        elseif @getfocus(big%)

            if @buttonstate(%getfocus) <> 108

                let f% = 1 - f%

                if f%

                    settext %getfocus,F

                else

                    settext %getfocus,f

                endif

                zeigeschrift

            endif

        elseif @getfocus(italic%)

            if @buttonstate(%getfocus) <> 108

                let k% = 1 - k%

                if k%

                    settext %getfocus,k

                else

                    settext %getfocus,k

                endif

                zeigeschrift

            endif

        elseif @getfocus(underlined%)

            if @buttonstate(%getfocus) <> 108

                let u% = 1 - u%

                if u%

                    settext %getfocus,u

                else

                    settext %getfocus,u

                endif

                zeigeschrift

            endif

        endif

    endwhile

    @destroywindow(_dlg%)

endproc

HAUPTPROGRAMM
=============
set(TrueColor,0)
windowstyle $11F
windowtitle Mini-Ed 1.0
window 20,20-555,452
cls @rgb(23,23,23)
PopUp &File
AppendMenu 100,&New
AppendMenu 101,&loading
AppendMenu 102,&Save
AppendMenu 103,Save &as
Separator
AppendMenu 109,&end
PopUp &Edit
AppendMenu 110,&Rückgänging 	old+BS
Separator
AppendMenu 111,&cut out 	Invoice values+Entf
AppendMenu 112,&copy 	Strg+Einfg
AppendMenu 113,&Insert 	Invoice values+Einfg
AppendMenu 114,&Delete 	Strg+Entf
PopUp &display
AppendMenu 200,&100 %
AppendMenu 201,1&50 %
AppendMenu 202,&200 %
AppendMenuBar 130,a&Info
CheckMenu 201,1
editor
end
 
07/15/07  
 



Zum Quelltext


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

1.643 Views

Untitledvor 0 min.
Rockford08/01/24
Sven Bader02/22/23
PETER195607/18/18
Peter Max Müller05/18/18
More...

Themeninformationen

this Topic has 1 subscriber:

unbekannt (1x)


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