|
Post by honky on Apr 14, 2023 8:24:17 GMT
Good morning, In this code, the vertical scrolling of texeditor "B" is synchronized with that of "A". Is there a way to synchronize the HORIZONTAL scrolling of "C" with that of "B" ? Thank you for.
NOMAINWIN mapw=360: maph= 350 WindowWidth=mapw+15: WindowHeight=maph+40 UpperLeftX = 10: UpperLeftY = 20 TEXTEDITOR #w.a, 10, 100, 150, 200 TEXTEDITOR #w.b, 170, 100, 150, 200 TEXTEDITOR #w.c, 170, 30, 150, 60 GRAPHICBOX #w.g, 5, 5, mapw, maph OPEN "Help" FOR window_nf AS #w #w, "TRAPCLOSE [closeHelp]" ' #w.m, "when leftButtonDown [scanne]" #w.g, "down;fill darkpink;color white;backcolor darkpink" #w.g, "font courrier 16 bold" #w.g, "place 80 90": #w.g, "\A" #w.g, "place 330 200": #w.g, "\B" #w.g, "place 330 70": #w.g, "\C" #w.g, "flush" for x=1 to 50 #w.a, str$(x) next x for x=1 to 50 b$=str$(x) for y=1 to 50 b$=b$+" "+str$(y) next y #w.b, b$ next x #w.c, b$ timer 400, [checkScrolling] [checkScrolling] scan #w.a "!origin? column row" #w.b "!origin ";column;" ";row ' #w.b "!origin ";column;" ";row ' #w.c "!origin ";column;" ";row wait [closeHelp] CLOSE #w END
|
|
|
Post by plus on Apr 14, 2023 8:45:41 GMT
I am following your example for row to do column:
NOMAINWIN mapw=360: maph= 350 WindowWidth=mapw+15: WindowHeight=maph+40 UpperLeftX = 10: UpperLeftY = 20 TEXTEDITOR #w.a, 10, 100, 150, 200 TEXTEDITOR #w.b, 170, 100, 150, 200 TEXTEDITOR #w.c, 170, 30, 150, 60 GRAPHICBOX #w.g, 5, 5, mapw, maph OPEN "Help" FOR window_nf AS #w #w, "TRAPCLOSE [closeHelp]" ' #w.m, "when leftButtonDown [scanne]" #w.g, "down;fill darkpink;color white;backcolor darkpink" #w.g, "font courrier 16 bold" #w.g, "place 80 90": #w.g, "\A" #w.g, "place 330 200": #w.g, "\B" #w.g, "place 330 70": #w.g, "\C" #w.g, "flush" for x=1 to 50 #w.a, str$(x) next x for x=1 to 50 b$=str$(x) for y=1 to 50 b$=b$+" "+str$(y) next y #w.b, b$ next x #w.c, b$ timer 400, [checkScrolling] [checkScrolling] scan #w.a "!origin? column row" #w.b "!origin ";column;" ";row '#w.b "!origin ";column;" ";row #w.c "!origin? column row1" #w.b "!origin ";column;" ";row wait [closeHelp] CLOSE #w END
|
|
|
Post by honky on Apr 14, 2023 10:23:18 GMT
that works, thank you. But therefore it is not possible to control: "C" by: "B"?
|
|
|
Post by Rod on Apr 14, 2023 12:46:01 GMT
I think it is a priority issue, one texteditor can be given priority but not any of the three. It is a limitation of not having a scrollbar change event, so the timer can only look at how they are now, which has priority in guiding the others? You might look at which is set at the furthest column or which is set at the furthest row and set all to the lowest or furthest position you find in any of the three.
|
|
|
Post by Brandon Parker on Apr 24, 2023 1:06:21 GMT
You could check for either being changed, but you would obviously have some sort of priority in the code itself.
NoMainWin mapw = 360 : maph = 350 WindowWidth = mapw + 15 : WindowHeight = maph + 40 UpperLeftX = 10: UpperLeftY = 20 TextEditor #w.a, 10, 100, 150, 200 TextEditor #w.b, 170, 100, 150, 200 GraphicBox #w.g, 5, 5, mapw, maph Open "Help" For window_nf As #w #w "TrapClose [closeHelp]" #w.g "Down; Fill DarkPink; Color White; BackColor DarkPink" #w.g "Font Courrier 16 Bold" #w.g "Place 70 90" : #w.g, "\A" #w.g "Place 235 90" : #w.g, "\B" #w.g "Flush"
For x = 1 To 50 b$ = str$(x) For y=1 To 50 b$ = b$ + " " + str$(y) Next y #w.a b$ #w.b b$ Next x Timer 400, [checkScrolling]
[checkScrolling] Scan columnLastA = columnA rowLastA = rowA columnLastB = columnB rowLastB = rowB
#w.a "!origin? columnA rowA" #w.b "!origin? columnB rowB"
Select Case Case (rowLastA <> rowA) #w.b "!origin ";columnB;" ";rowA Case (rowLastB <> rowB) #w.a "!origin ";columnA;" ";rowB End Select
Select Case Case (columnLastA <> columnA) #w.b "!origin ";columnA;" ";rowB Case (columnLastB <> columnB) #w.a "!origin ";columnB;" ";rowA End Select Wait
[closeHelp] Close #w End
{:0)
Brandon Parker
|
|