Board Logo
« Difficulty with Texteditor »

Welcome Guest. Please Login or Register.
Jan 16th, 2018, 3:32pm


Conforums Terms of Service | Membership Rules | Home | Search | Recent Posts | Notification | Format Your Message | Installation FAQ

Please use the forums Search feature before asking.
Please post code using the code box described in Format Your Messages.
This will keep indentation, separate it better form the message and prevent gibberish.
If the code is too long for one post or additional files are needed, upload a ZIP archive to the Just BASIC Files Archive Site.

« Previous Topic | Next Topic »
Pages: 1  Notify Send Topic Print
 thread  Author  Topic: Difficulty with Texteditor  (Read 242 times)
Angelo2449
Member in Training
ImageImage


member is offline

Avatar




PM

Gender: Male
Posts: 58
xx Difficulty with Texteditor
« Thread started on: Oct 20th, 2017, 4:02pm »

Hi guys,
I have difficulty with managing Texeditor, if I try to select a part of the text contained in the window, I get strange effects.
Thank you.

Code:

    nomainwin

    on error goto [AbbErr]

    WindowWidth  = 1120
    WindowHeight = 750

    UpperLeftX = 10
    UpperLeftY = 10

    BackgroundColor$ = "darkcyan"
    ForegroundColor$ = "black"

    statictext #dual.txt1, "Finestra sx", 20, 20, 120, 20
    textbox #dual.titolo1, 140, 15, 400, 25

    TexteditorColor$ = "yellow"
    texteditor #dual.textedit1, 20, 50, 520, 570

    statictext #dual.txt2, "Finestra dx", 560, 20, 120, 20
    textbox #dual.titolo2, 680, 15, 400, 25

    TexteditorColor$ = "cyan"
    texteditor #dual.textedit2, 560, 50, 520, 570

    button #dual.salvacome1, "Salva Come", [SalvaComeSx], UL, 20, 640, 100, 35
    button #dual.pulisci1, "Pulisci", [CancellaUno], UL, 160, 640, 80, 35
    button #dual.apriUno, "Apri", [ApriSx], UL, 260, 640, 80, 35
    button #dual.salvaUno, "Salva", [SalvaSx], UL, 360, 640, 80, 35

    button #dual.salvacome2, "Salva Come", [SalvaComeDx], UL, 560, 640, 100, 35
    button #dual.pulisci2, "Pulisci", [CancellaDue], UL, 700, 640, 80, 35
    button #dual.apriDue, "Apri", [ApriDx], UL, 800, 640, 80, 35
    button #dual.salvaDue, "Salva", [SalvaDx], UL, 900, 640, 80, 35
    button #dual.exit, "Esci", [quit.editor], UL, 1000, 640, 80, 35

    open "Dual - Editor" for window as #dual
    #dual, "font courier_new 10 16 bold"
    #dual, "trapclose [quit.editor]"
    #dual.textedit1, "!enable"
    #dual.textedit2, "!enable"
    #dual.textedit1, "!setfocus"

    if DualControl > 0 then

        #dual.apriUno, "!disable"
        #dual.apriDue, "!disable"

        open FileDaAprireGen$ for input as #11
            while eof(#11) = 0
                line input #11, RigaUno$
                #dual.textedit1, RigaUno$
            wend
        close #11

        open FileDaAprireECEF$ for input as #22
            while eof(#22) = 0
                line input #22, RigaDue$
                #dual.textedit2, RigaDue$
            wend
        close #22

        column = 1 : row = 1
        #dual.textedit1, "!origin ";column;" ";row
        #dual.textedit2, "!origin ";column;" ";row
        #dual.abbina, "!disable"
        #dual.exit, "Prosegui"

    end if

    wait

    ' --------------------------

    [AbbErr]

    close #11
    close #22

    wait

    ' ----------------------

    [ApriSx]

    filedialog "Open - Apri", "D:\", FileDaAprireUno$

    if trim$(FileDaAprireUno$) <> "" then
        open FileDaAprireUno$ for input as #1
        #dual.titolo1, FileDaAprireUno$
        while eof(#1) = 0
            line input #1, A$
            #dual.textedit1, A$
        wend
        close #1
    end if

    column = 1 : row = 1
    #dual.textedit1, "!origin ";column;" ";row

    FileDaTrattare$ = FileDaAprireUno$

    wait

    ' ----------------------

    [ApriDx]

    filedialog "Open - Apri", "D:\", FileDaAprireDue$

    if trim$(FileDaAprireDue$) <> "" then
        #dual.titolo2, FileDaAprireDue$
        open FileDaAprireDue$ for input as #2
        while eof(#2) = 0
            line input #2, B$
            #dual.textedit2, B$
        wend
        close #2
    end if

    column = 1 : row = 1
    #dual.textedit2, "!origin ";column;" ";row
    wait

    ' ----------------------

    [SalvaSx]

    gosub [SalvaSxUno]
    wait

    ' ----------------

    [SalvaSxUno]

    if trim$(FileDaAprireUno$) <> "" then
        #dual.textedit1, "!contents? SelectedUno$"

        open FileDaAprireUno$ for output as #3
            print #3, SelectedUno$
        close #3

        Notice "Comunicato" + chr$(13) + "Il file  stato salvato come : "; FileDaAprireUno$
    else
        Notice "Attenzione" + chr$(13) + "Devi prima aprire un file"
    end if

    return

    ' -------------------------------------------------------------------------------------

    [SalvaDx]

    gosub [SalvaDxUno]
    wait

    ' ----------------

    [SalvaDxUno]

    if trim$(FileDaAprireDue$) <> "" then
        #dual.textedit2, "!contents? SelectedDue$"

        open FileDaAprireDue$ for output as #4
            print #4, SelectedDue$
        close #4

        Notice "Comunicato" + chr$(13) + "Il file  stato salvato come : "; FileDaAprireDue$
    else
        Notice "Attenzione" + chr$(13) + "Devi prima aprire un file"
    end if

    FileSalvato$ = FileDaAprireDue$
    SalvaDx = 1

    return

    ' ------------------------------------------------------------------------------------

    [SalvaComeSx]

    filedialog "Save - Apri", "D:\", FileDaSalvareUno$

    if trim$(FileDaSalvareUno$) <> "" then
        #dual.textedit1, "!contents? SelectedUno$"

        open FileDaSalvareUno$ for output as #3
            print #3, SelectedUno$
        close #3

        Notice "Comunicato" + chr$(13) + "Il file  stato salvato come : "; FileDaSalvareUno$ 
    end if

    wait

    ' ----------------------

    [SalvaComeDx]

    filedialog "Save - Apri", "D:\", FileDaSalvareDue$

    if trim$(FileDaSalvareDue$) <> "" then
        #dual.textedit2, "!contents? SelectedDue$"

        open FileDaSalvareDue$ for output as #4
            print #4, SelectedDue$
        close #4

        Notice "Comunicato" + chr$(13) + "Il file  stato salvato come : "; FileDaSalvareDue$
    end if

    FileSalvato$ = FileDaAprireDue$
    SalvaComeDx = 1

    wait

    ' ----------------------

    [CancellaUno]

    #dual.titolo1, ""
    #dual.textedit1, "!cls"
    FileDaAprireUno$ = ""
    FileDaSalvareUno$ = ""
    wait

    ' ----------------------

    [CancellaDue]

    #dual.titolo2, ""
    #dual.textedit2, "!cls"
    FileDaAprireDue$ = ""
    FileDaSalvareDue$ = ""
    wait

    ' ----------------------

    [quit.editor]

    on error goto [CloseDualErr]

    select case DualControl

        case 1
        DualControl = 0
        close #dual

        case 2
        DualControl = 0
        close #dual

    end select

    DualControlUno = 0

    ' -------------------------------------

    #dual.textedit1, "!modified? answerUno$"
    #dual.textedit2, "!modified? answerDue$"

    if answerUno$ = "true" then
        Messaggio1$ = "Il contenuto della finestra sx  stato modificato, vuoi salvarlo?"
        Aspetto$ = "Ciano"
        gosub [Conferma]
        if Risposta$ = "Si" then gosub [SalvaSxUno]
    end if

    if answerDue$ = "true" then
        Messaggio1$ = "Il contenuto della finestra sx  stato modificato, vuoi salvarlo?"
        Aspetto$ = "Ciano"
        gosub [Conferma]
        if Risposta$ = "Si" then gosub [SalvaSxUno]
    end if

    close #dual
    wait

    ' ---------------------------

    [CloseDualErr]

    NonChiudere = 0
    wait

    ' -------------------------------------------------------------------------------------
 



User IP Logged

zzz000abc
Full Member
ImageImageImageImage


member is offline

Avatar




PM

Gender: Male
Posts: 268
xx Re: Difficulty with Texteditor
« Reply #1 on: Oct 20th, 2017, 4:59pm »

Hi,
I checked the output.
I opened a bas file through the window selected and copied some text and pasted in the same window and in the next window ,found no strange results!.
Every thing was normal.
Can you describe what problem you are getting ?
Can you change the language on the buttons to English?
User IP Logged

Angelo2449
Member in Training
ImageImage


member is offline

Avatar




PM

Gender: Male
Posts: 58
xx Re: Difficulty with Texteditor
« Reply #2 on: Oct 20th, 2017, 11:07pm »

Thanks for your kind reply,
I get strange effects (character additions or omission of characters) if, from one of the two windows, copy text , dragging the mouse cursor.
Copying text to clipboard is not correct.
I translated the text to English.
Thanks.
Code:

    nomainwin

    on error goto [AbbErr]

    WindowWidth  = 1120
    WindowHeight = 750

    UpperLeftX = 10
    UpperLeftY = 10

    BackgroundColor$ = "darkcyan"
    ForegroundColor$ = "black"

    statictext #dual.txt1, "Window sx", 20, 20, 120, 20
    textbox #dual.titolo1, 140, 15, 400, 25

    TexteditorColor$ = "yellow"
    texteditor #dual.textedit1, 20, 50, 520, 570

    statictext #dual.txt2, "Window dx", 560, 20, 120, 20
    textbox #dual.titolo2, 680, 15, 400, 25

    TexteditorColor$ = "cyan"
    texteditor #dual.textedit2, 560, 50, 520, 570

    button #dual.salvacome1, "Save as", [SalvaComeSx], UL, 20, 640, 100, 35
    button #dual.pulisci1, "Erase", [CancellaUno], UL, 160, 640, 80, 35
    button #dual.apriUno, "Open", [ApriSx], UL, 260, 640, 80, 35
    button #dual.salvaUno, "Save", [SalvaSx], UL, 360, 640, 80, 35

    button #dual.salvacome2, "Save as", [SalvaComeDx], UL, 560, 640, 100, 35
    button #dual.pulisci2, "Erase", [CancellaDue], UL, 700, 640, 80, 35
    button #dual.apriDue, "Open", [ApriDx], UL, 800, 640, 80, 35
    button #dual.salvaDue, "Save", [SalvaDx], UL, 900, 640, 80, 35
    button #dual.exit, "Exit", [quit.editor], UL, 1000, 640, 80, 35

    open "Dual - Editor" for window as #dual
    #dual, "font courier_new 10 16 bold"
    #dual, "trapclose [quit.editor]"
    #dual.textedit1, "!enable"
    #dual.textedit2, "!enable"
    #dual.textedit1, "!setfocus"

    if DualControl > 0 then

        #dual.apriUno, "!disable"
        #dual.apriDue, "!disable"

        open FileDaAprireGen$ for input as #11
            while eof(#11) = 0
                line input #11, RigaUno$
                #dual.textedit1, RigaUno$
            wend
        close #11

        open FileDaAprireECEF$ for input as #22
            while eof(#22) = 0
                line input #22, RigaDue$
                #dual.textedit2, RigaDue$
            wend
        close #22

        column = 1 : row = 1
        #dual.textedit1, "!origin ";column;" ";row
        #dual.textedit2, "!origin ";column;" ";row
        #dual.abbina, "!disable"
        #dual.exit, "Prosegui"

    end if

    wait

    ' --------------------------

    [AbbErr]

    close #11
    close #22

    wait

    ' ----------------------

    [ApriSx]

    filedialog "Open - Apri", "D:\", FileDaAprireUno$

    if trim$(FileDaAprireUno$) <> "" then
        open FileDaAprireUno$ for input as #1
        #dual.titolo1, FileDaAprireUno$
        while eof(#1) = 0
            line input #1, A$
            #dual.textedit1, A$
        wend
        close #1
    end if

    column = 1 : row = 1
    #dual.textedit1, "!origin ";column;" ";row

    FileDaTrattare$ = FileDaAprireUno$

    wait

    ' ----------------------

    [ApriDx]

    filedialog "Open - Apri", "D:\", FileDaAprireDue$

    if trim$(FileDaAprireDue$) <> "" then
        #dual.titolo2, FileDaAprireDue$
        open FileDaAprireDue$ for input as #2
        while eof(#2) = 0
            line input #2, B$
            #dual.textedit2, B$
        wend
        close #2
    end if

    column = 1 : row = 1
    #dual.textedit2, "!origin ";column;" ";row
    wait

    ' ----------------------

    [SalvaSx]

    gosub [SalvaSxUno]
    wait

    ' ----------------

    [SalvaSxUno]

    if trim$(FileDaAprireUno$) <> "" then
        #dual.textedit1, "!contents? SelectedUno$"

        open FileDaAprireUno$ for output as #3
            print #3, SelectedUno$
        close #3

        Notice "Comunicato" + chr$(13) + "The file was saved as : "; FileDaAprireUno$
    else
        Notice "Attenzione" + chr$(13) + "You must first open a file"
    end if

    return

    ' -------------------------------------------------------------------------------------

    [SalvaDx]

    gosub [SalvaDxUno]
    wait

    ' ----------------

    [SalvaDxUno]

    if trim$(FileDaAprireDue$) <> "" then
        #dual.textedit2, "!contents? SelectedDue$"

        open FileDaAprireDue$ for output as #4
            print #4, SelectedDue$
        close #4

        Notice "Comunicato" + chr$(13) + "The file was saved as : "; FileDaAprireDue$
    else
        Notice "Attenzione" + chr$(13) + "You must first open a file"
    end if

    FileSalvato$ = FileDaAprireDue$
    SalvaDx = 1

    return

    ' ------------------------------------------------------------------------------------

    [SalvaComeSx]

    filedialog "Save - Apri", "D:\", FileDaSalvareUno$

    if trim$(FileDaSalvareUno$) <> "" then
        #dual.textedit1, "!contents? SelectedUno$"

        open FileDaSalvareUno$ for output as #3
            print #3, SelectedUno$
        close #3

        Notice "Comunication" + chr$(13) + "The File is saved as : "; FileDaSalvareUno$ 
    end if

    wait

    ' ----------------------

    [SalvaComeDx]

    filedialog "Save - Apri", "D:\", FileDaSalvareDue$

    if trim$(FileDaSalvareDue$) <> "" then
        #dual.textedit2, "!contents? SelectedDue$"

        open FileDaSalvareDue$ for output as #4
            print #4, SelectedDue$
        close #4

        Notice "Comunicato" + chr$(13) + "The File is saved as : "; FileDaSalvareDue$
    end if

    FileSalvato$ = FileDaAprireDue$
    SalvaComeDx = 1

    wait

    ' ----------------------

    [CancellaUno]

    #dual.titolo1, ""
    #dual.textedit1, "!cls"
    FileDaAprireUno$ = ""
    FileDaSalvareUno$ = ""
    wait

    ' ----------------------

    [CancellaDue]

    #dual.titolo2, ""
    #dual.textedit2, "!cls"
    FileDaAprireDue$ = ""
    FileDaSalvareDue$ = ""
    wait

    ' ----------------------

    [quit.editor]

    on error goto [CloseDualErr]

    select case DualControl

        case 1
        DualControl = 0
        close #dual

        case 2
        DualControl = 0
        close #dual

    end select

    DualControlUno = 0

    ' -------------------------------------

    #dual.textedit1, "!modified? answerUno$"
    #dual.textedit2, "!modified? answerDue$"

    if answerUno$ = "true" then
        Messaggio1$ = "Il contenuto della finestra sx  stato modificato, vuoi salvarlo?"
        Aspetto$ = "Ciano"
        gosub [Conferma]
        if Risposta$ = "Si" then gosub [SalvaSxUno]
    end if

    if answerDue$ = "true" then
        Messaggio1$ = "Il contenuto della finestra sx  stato modificato, vuoi salvarlo?"
        Aspetto$ = "Ciano"
        gosub [Conferma]
        if Risposta$ = "Si" then gosub [SalvaSxUno]
    end if

    close #dual
    wait

    ' ---------------------------

    [CloseDualErr]

    NonChiudere = 0
    wait

    ' -------------------------------------------------------------------------------------
 
User IP Logged

Rod
Administrator
ImageImageImageImageImage


member is offline

Avatar

Graphics = Goosebumps!


PM

Gender: Male
Posts: 3151
xx Re: Difficulty with Texteditor
« Reply #3 on: Oct 22nd, 2017, 03:16am »

Your code runs ok for me. I can cut copy and paste any text with the mouse from window to window, even external text without error.

What happens with a real word processor like Word? Do you still get clipboard errors?
User IP Logged

Angelo2449
Member in Training
ImageImage


member is offline

Avatar




PM

Gender: Male
Posts: 58
xx Re: Difficulty with Texteditor
« Reply #4 on: Oct 22nd, 2017, 10:42am »

Hi Rod,
with other programs like> Notepad < or > Word <, everything works perfectly, so I can copy and paste it.
Only in Texteditor I have big problems.
I would like to send some screen captures but I do not know how to do it.
Tank you, Angelo
User IP Logged

Rod
Administrator
ImageImageImageImageImage


member is offline

Avatar

Graphics = Goosebumps!


PM

Gender: Male
Posts: 3151
xx Re: Difficulty with Texteditor
« Reply #5 on: Oct 22nd, 2017, 2:47pm »

Try andccopy and paste the text you are having problems with to this message board.

I would also make sure your screen driver software and mouse driver software are bang up to date.
User IP Logged

tsh73
JB-Supporter


member is offline

Avatar




PM

Gender: Male
Posts: 3635
xx Re: Difficulty with Texteditor
« Reply #6 on: Oct 23rd, 2017, 03:56am »

So you have textbox AND texeditor
and problems with texeditor?

Read it looks like this bug
TEXTEDITOR - focus on paste action not checked
It is fixed in LB 4.5, but JB is based on older version (4.03 or something).
Carl hinted at JB 2.0...

User IP Logged

Q: "And if I took your codes and compile them, and sell them for a profit"?
A: Go ahead. I had my share of good then I coded it for fun, if you can make better use of it - please do.
(enjoying JB 1.01 on WinXP, netbook and desktop)
Angelo2449
Member in Training
ImageImage


member is offline

Avatar




PM

Gender: Male
Posts: 58
xx Re: Difficulty with Texteditor
« Reply #7 on: Oct 23rd, 2017, 04:01am »

Hi Rod,
I normally use the mouse wifi (Dust), today I used the notebook mouse and everything works perfectly!
Obviously it is the mouse or the driver.
Thank you, Angelo.
User IP Logged

Rod
Administrator
ImageImageImageImageImage


member is offline

Avatar

Graphics = Goosebumps!


PM

Gender: Male
Posts: 3151
xx Re: Difficulty with Texteditor
« Reply #8 on: Oct 23rd, 2017, 1:52pm »

I have worn out more than one mouse button contact!
User IP Logged

Pages: 1  Notify Send Topic Print
« Previous Topic | Next Topic »

Conforums Terms of Service | Membership Rules | Home | Search | Recent Posts | Notification | Format Your Message | Installation FAQ

Donate $6.99 for 50,000 Ad-Free Pageviews!

| |

This forum powered for FREE by Conforums ©
Sign up for your own Free Message Board today!
Terms of Service | Privacy Policy | Conforums Support | Parental Controls