Board Logo
« Problems with Texteditor »

Welcome Guest. Please Login or Register.
Oct 17th, 2017, 3:14pm


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: Problems with Texteditor  (Read 215 times)
Angelo2449
Member in Training
ImageImage


member is offline

Avatar




PM

Gender: Male
Posts: 44
xx Problems with Texteditor
« Thread started on: Jul 13th, 2017, 08:01am »

Hi guys,
I have problems with the use of Texteditor.

After entering the text in the window (texteditor), I can not correctly select a part of the text with the mouse.

The characters during the selection are not stable, they move, it is almost impossible to select test with the mouse.

Is not this a very common text? (.txt)

Tank you-.

User IP Logged

Facundo
Board Moderator


member is offline

Avatar




PM

Gender: Male
Posts: 1292
xx Re: Problems with Texteditor
« Reply #1 on: Jul 13th, 2017, 10:27am »

Hi Angelo. Do you have a timed loop, a tight loop in your code? something that is stealing focus. The MAINWIN, and printing to it perhaps? Please post the code you are having problems with, or a portion of code so we can replicate the problem and find a solution.
User IP Logged

cundo aka MSlayer
Angelo2449
Member in Training
ImageImage


member is offline

Avatar




PM

Gender: Male
Posts: 44
xx Re: Problems with Texteditor
« Reply #2 on: Jul 13th, 2017, 4:39pm »

Hi Facundo,

I attach a part of the code, here only works the listbox.

At first, copy and paste work, then I have problems
Code:
    nomainwin

    on error goto [GestErr]

    WindowWidth  = 1005
    WindowHeight = 700

    UpperLeftX = (DisplayWidth - WindowWidth) / 2
    UpperLeftY = (DisplayHeight - WindowHeight) / 2

    BackgroundColor$ = "green"
    TextboxColor$ = "yellow"

    dim Contatto$(200)
    dim sa$(200)
    dim sas$(200)
    dim M$(50)

    statictext #main.ext1, "Da cercare", 30, 40, 100, 20
    textbox #main.boxcerca, 30, 60, 450, 25

    button #main.cerca, "Cerca", [Main.Cerca], UL, 380, 105, 100, 30

    statictext #main.text2, "Trovato - Da Inserire", 30, 145, 200, 20
    textbox #main.trovato, 30, 170, 450, 25

    statictext #main.text3, "Informazioni", 30, 215, 95, 20
    texteditor #main.informazioni, 30, 245, 450, 300

    statictext #main.phone, "Telefono >>>", 210, 215, 100, 20
    textbox #main.telefono, 320, 210, 160, 25

    statictext #main.list, "Lista dei Contatti", 510, 30, 145, 20
    listbox #main.listbox, Contatto$(), [ContattiList], 510, 60, 450, 485

    button #main.pandi, "Persone & Indirizzi", [Main.PandI], UL, 760, 25, 200, 25

    button #main.organizza, "Organizza", [Main.Organizza], UL, 30, 570, 100, 30
    button #main.modifica, "Modifica", [Main.Modifica], UL, 140, 570, 100, 30
    button #main.elimina, "Elimina", [Main.Elimina], UL, 250, 570, 100, 30
    button #main.inserisci, "Inserisci", [Main.Inserisci], UL, 360, 570, 100, 30
    button #main.pulisci, "Pulisci", [Main.Pulisci], UL, 470, 570, 100, 30
    button #main.stampa, "Stampa", [Main.Stampa], UL, 580, 570, 100, 30
    button #main.info, "Info", [Main.Info], UL, 750, 570, 100, 30
    button #main.esci, "Esci", [Main.Esci], UL, 860, 570, 100, 30

    open "Contatti - Persone & Indirizzi" for window as #main
    #main, "font courier_new 10 16 bold"
    #main, "trapclose [Main.Esci]"
    #main.informazioni, "!enable"
    #main.informazioni, "!enable"
    column = 1
    row = 1
    #main.informazioni, "!origin column row"
    #main.listbox, "selection? Nome$"
    #main.listbox, "singleclickselect"
    #main.listbox, "selectionindex? Index"
    #main.listbox, "enable"
    #main.boxcerca, "!setfocus"

    if FileExists ("D:\Persone & Indirizzi\Archivio\Archivio.dat") then
        open "D:\Persone & Indirizzi\Archivio\Archivio.dat" for random as #1 len = 100
            field #1, 48 as Nome$, 15 as Telefono$, 37 as Riserva$

            Ultimo = lof(#1) / 100

            for i = 1 to lof(#1) / 100
                get #1, i
                Contatto$(i) = Nome$
            next i

        #main.listbox, "reload"
    end if

    wait

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

    [ContattiList]

    #main.listbox, "selectionindex? Index"
    if Index = 0 then wait

    get #1, Index
    #main.informazioni, "!cls"
    #main.listbox, "selection? Nome$"
    #main.trovato, Nome$
    #main.telefono, trim$(Telefono$)

    if FileExists("D:\Persone & Indirizzi\Archivio\Cliente" + str$(Index) + ".dat") then
        open "D:\Persone & Indirizzi\Archivio\Cliente" + str$(Index) + ".dat" for input as #2
            while eof(#2) = 0
                line input #2, Riga$
                #main.informazioni, Riga$
            wend
        close #2
    end if

    column = 1
    row = 1
    #main.informazioni, "!origin column row"

    wait

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

    [Main.Esci]

    if FileExists ("D:\Persone & Indirizzi\Copia\Archivio.dat") then
        kill "D:\Persone & Indirizzi\Copia\Archivio.dat"
    end if

    if FileExists ("D:\Persone & Indirizzi\Archivio\Archivio.dat") then
        open "D:\Persone & Indirizzi\Archivio\Archivio.dat" for input as #original
        open "D:\Persone & Indirizzi\Copia\Archivio.dat" for output as #copy
        print #copy, input$(#original, lof(#original));
        close #original
        close #copy
    end if

    close #main
    close #1
    end

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

    ' @FEX

    function FileExists(FilePath$)
        dim FileExistsInfo$(1,1)    ' ritorna 0 (zero) se il file non esiste, 1 (uno) se esiste
        files "", FilePath$, FileExistsInfo$(
        FileExists = val(FileExistsInfo$(0,0))
    end function

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

 


Maybe it's the mouse!

Tank you
User IP Logged

Rod
Administrator
ImageImageImageImageImage


member is offline

Avatar

Graphics = Goosebumps!


PM

Gender: Male
Posts: 3100
xx Re: Problems with Texteditor
« Reply #3 on: Jul 14th, 2017, 06:40am »

Lets keep it real simple, does this code give you the same problem? If your mouse is broken it won't work in any program, does the mouse behave normally in other programs?


Code:
nomainwin
open "Test" for text as #text
#text "!trapclose [quit]"
wait


[quit]
close #text
end
 



As stated if this is specific to your own coded program then you have a loop or event running that is interfering with the focus.
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