Author Topic: A skeleton code for Text Scroller via Drag-and-Drop  (Read 29977 times)

0 Members and 1 Guest are viewing this topic.

This topic contains a post which is marked as Best Answer. Press here if you would like to see it.

Offline Sanmayce

  • Newbie
  • Posts: 63
  • Where is that English Text Sidekick?
    • View Profile
    • Sanmayce's home
A skeleton code for Text Scroller via Drag-and-Drop
« on: January 20, 2021, 05:18:19 am »
 

Hi,
an oldboy being a big fan of QB 2.0, QB 4.0, QB 4.5 and QBX 7.1 here.

So glad that few days ago found QB64, a dream relived, as I see it.
Many thanks to QB64 team, really you gladdened my eyes, the IDE feels as it should, the stand alone executable is seconds away, so convenient, bravo!

25 years ago I wrote some original tools in QB45 + MASM functions, loved that pair, thought that experience was past long gone, now I see I haven't killed the quickening within.

Last night wrote my first QB64 program, gladly sharing it here , my wish is to continue to enrich its functionality...
To community, feel free to point out the stupid parts you see in it.

My idea is to invoke my [searching] console tools (written in C) via this "GUI SHELL" and showing their output in this QB64 window...

Code: QB64: [Select]
  1. ' DragDropWheel.bas
  2. ' written in QB64 v1.4 by Kaze, 2021-Jan-20
  3.  
  4. _TITLE "DragDropWheel"
  5. CONST RSHIFT& = 100303
  6. CONST LSHIFT& = 100304
  7.  
  8. XdimCOL = 160
  9. YdimROW = 44 ' ensure old laptops with 768pixels vertical will hold the whole window
  10. IF high& > 1000 THEN YdimROW = 60
  11. handle& = _NEWIMAGE(XdimCOL, YdimROW, 0)
  12. SCREEN handle&
  13.  
  14. ' Either one must be uncommented:
  15. '_AUTODISPLAY 'no need of refreshing
  16.  
  17. _ACCEPTFILEDROP 'enables drag/drop functionality
  18.  
  19. IF INSTR(LCASE$(COMMAND$), "/purple") THEN
  20.     COLOR 9, 0
  21.     COLOR 3, 0
  22.  
  23. PRINT "Current working directory path: "; CHR$(34); _CWD$; CHR$(34)
  24. PRINT "User's program calling path: "; CHR$(34); _STARTDIR$; CHR$(34)
  25. PRINT "Command line parameters sent when a program is started: "; CHR$(34); COMMAND$; CHR$(34)
  26. PRINT "_OS$="; _OS$
  27.  
  28. 'Y = CSRLIN 'save the row
  29. 'X = POS(0) 'save the column
  30.  
  31. filecount% = 0
  32. REDIM FileArray$(1000000) 'create dynamic array: 3880000 alocates 532MB - bigger values need 570+MB and give "Out Of Memory"
  33.  
  34. FOR i = 1 TO YdimROW
  35.     FileArray$(i) = ""
  36.  
  37. PRINT "Drag files from a folder and drop them in this window..."
  38. 'REDIM FileArray$(filecount%)
  39.  
  40. 'pressakey$ = INPUT$(1)
  41.  
  42. a$ = ""
  43.         'FOR i = 1 TO _TOTALDROPPEDFILES
  44.         'a$ = _DROPPEDFILE(i)
  45.         a$ = _DROPPEDFILE(1)
  46.         'NEXT'
  47.         _FINISHDROP 'If _FINISHDROP isn't called here then _TOTALDROPPEDFILES never gets reset.
  48.         '    ELSE
  49.         '        a$ = "Scroller.$$$"
  50.         '       SHELL _HIDE "DIR /B *.* > Scroller.$$$"
  51.     END IF
  52.  
  53.     IF _FILEEXISTS(a$) THEN
  54.         OPEN a$ FOR INPUT AS #1
  55.         DO UNTIL EOF(1)
  56.             LINE INPUT #1, filename$ 'read entire text file line
  57.             filecount% = filecount% + 1
  58.             FileArray$(filecount%) = filename$
  59.         LOOP
  60.         CLOSE #1
  61.     END IF
  62.     _LIMIT 30
  63. LOOP WHILE a$ = ""
  64.  
  65. 'PRINT "Printing filenames in current directory... ";: PRINT LTRIM$(STR$(filecount%))
  66.  
  67. FOR i = 1 TO YdimROW 'filecount%
  68.     IF LEN(FileArray$(i)) >= XdimCOL THEN
  69.         FileArray$(i) = MID$(FileArray$(i), 1, XdimCOL)
  70.     ELSE
  71.         FileArray$(i) = FileArray$(i) + SPACE$(XdimCOL - LEN(FileArray$(i)))
  72.     END IF
  73.     LOCATE i, 1: PRINT FileArray$(i);
  74.  
  75. LOCATE 1, 1
  76. crx = POS(0)
  77. cry = CSRLIN
  78. crxOLD = crx
  79. cryOLD = cry
  80. LOCATE cry, crx, 1, 30, 31
  81.  
  82. IF INSTR(LCASE$(COMMAND$), "/purple") THEN
  83.     COLOR 8, 0
  84.     COLOR 0, 3
  85. PRINT FileArray$(cry);
  86.     IF _KEYDOWN(LSHIFT&) THEN PLAY "L8V2ff-"
  87.     IF _KEYDOWN(RSHIFT&) THEN PLAY "L8V2a-c-"
  88.     'LOCATE cry, crx, 1, 30, 31
  89.     key$ = INKEY$
  90.     'DO: a$ = INKEY$: LOOP UNTIL a$ <> "" ' prevent ASC empty string read error
  91.     IF key$ <> "" THEN
  92.         code% = ASC(key$):
  93.         IF code% THEN ' ASC returns any value greater than 0
  94.             SELECT CASE ASC(key$)
  95.                 CASE 65 TO 97: 'PRINT key$;
  96.                 CASE ASC("a") TO ASC("z"): 'PRINT key$;
  97.                 CASE 27: COLOR 7, 0: SYSTEM 'END
  98.             END SELECT
  99.         ELSE
  100.             SELECT CASE ASC(key$, 2)
  101.                 CASE 72: IF cry > 1 THEN cry = cry - 1 'up
  102.                 CASE 80: IF cry < YdimROW THEN cry = cry + 1 'down
  103.                 CASE 75: IF crx > 1 THEN crx = crx - 1 'left
  104.                 CASE 77: IF crx < XdimCOL THEN crx = crx + 1 'right
  105.             END SELECT
  106.         END IF
  107.     END IF
  108.     IF cryOLD <> cry THEN
  109.         'LOCATE cryOLD, crx, 1, 30, 31: COLOR 3, 0: PRINT FileArray$(cryOLD);
  110.         LOCATE cryOLD, 1, 1, 30, 31
  111.         IF INSTR(LCASE$(COMMAND$), "/purple") THEN
  112.             COLOR 9, 0
  113.         ELSE
  114.             COLOR 3, 0
  115.         END IF
  116.         PRINT FileArray$(cryOLD);
  117.         cryOLD = cry
  118.     ELSE 'it 'cry' could be changed by Mouse Wheel too, check it
  119.         AsIfItIsINKEY% = _MOUSEINPUT '      Check the mouse status
  120.         IF _MOUSEWHEEL = 1 THEN ' as if Down
  121.             IF cry < YdimROW THEN cry = cry + 1 'down
  122.         END IF
  123.         IF _MOUSEWHEEL = -1 THEN ' as if Up
  124.             IF cry > 1 THEN cry = cry - 1 'up
  125.         END IF
  126.     END IF
  127.     'LOCATE cry, crx, 1, 30, 31: COLOR 0, 3: PRINT FileArray$(cry);
  128.     LOCATE cry, 1, 1, 30, 31
  129.     IF INSTR(LCASE$(COMMAND$), "/purple") THEN
  130.         COLOR 8, 0
  131.     ELSE
  132.         COLOR 0, 3
  133.     END IF
  134.  
  135.     PRINT FileArray$(cry);
  136.     _DISPLAY
  137.     'DO WHILE INKEY$ <> "": LOOP ' have to clear the keyboard buffer
  138.     '_LIMIT 30 'commented because the wheel up/down was not working?!
  139.  
  140.  

 
5.png
« Last Edit: January 20, 2021, 05:25:59 am by Sanmayce »
He learns not to learn and reverts to what all men pass by.

Offline SMcNeill

  • QB64 Developer
  • Forum Resident
  • Posts: 3972
    • View Profile
    • Steve’s QB64 Archive Forum
Re: A skeleton code for Text Scroller via Drag-and-Drop
« Reply #1 on: January 20, 2021, 06:15:46 am »
A better solution for mouse handling:

Code: QB64: [Select]
  1.   DO
  2.        CLS
  3.        WHILE _MOUSEINPUT
  4.              scroll = scroll + _MOUSEWHEEL
  5.        WEND
  6.        IF scroll < 0 THEN scroll = 100
  7.        IF scroll > 100 THEN scroll = 0
  8.        PRINT scroll
  9.        _DISPLAY
  10.        _LIMIT 30
  11.    LOOP UNTIL _KEYHIT = 27
  12.  

In the above, my mousewheel will scroll from 0 to 100, and wrap from high to low, without any lag or drag on performance.  For your needs, just substitute your (max line count - number of lines on screen) instead of 100, and scroll should be the line you’d start printing to the screen.  (Assuming no word wrap occurs, of course.)
https://github.com/SteveMcNeill/Steve64 — A github collection of all things Steve!

FellippeHeitor

  • Guest
Re: A skeleton code for Text Scroller via Drag-and-Drop
« Reply #2 on: January 20, 2021, 11:11:03 am »
Welcome aboard, @Sanmayce! Cool to see you're already getting it going with several modern keywords as well! Looking forward to your future contributions.

Offline Pete

  • Forum Resident
  • Posts: 2361
  • Cuz I sez so, varmint!
    • View Profile
Re: A skeleton code for Text Scroller via Drag-and-Drop
« Reply #3 on: January 20, 2021, 11:28:27 am »
@Steve,

Don't forget to tell him about NOT adding other mouse commands, like _MOUSEBUTTON(1), etc. inside that loop, but rather to add them outside and after it terminates.

Pete
Want to learn how to write code on cave walls? https://www.tapatalk.com/groups/qbasic/qbasic-f1/

Offline Pete

  • Forum Resident
  • Posts: 2361
  • Cuz I sez so, varmint!
    • View Profile
Re: A skeleton code for Text Scroller via Drag-and-Drop
« Reply #4 on: January 20, 2021, 11:42:22 am »
@FellippeHeitor

Hey Fell, looks like you've got another old-TIMER in the fold. We're getting to be a pretty big group around here. If this keeps up, you'll have to offer us a senior discount. Since this is an open source project, that means you'll owe us money! :D

@Sanmayce

Welcome. I like GUI the stuff, too. I've got a project I'm working on currently, posted over at the QBasic forum. Since you're an old-timer, do you remember that forum? Network54 used to host it. Now it's on Tapatalk. Mallord was the first admin, followed by Mac, and Mac turned it over to me, when he passed away in 2008. Anyway, I'm just curious if you recall it, or Pete's QBasic forum, or any of the others back in the day.

Pete
Want to learn how to write code on cave walls? https://www.tapatalk.com/groups/qbasic/qbasic-f1/

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: A skeleton code for Text Scroller via Drag-and-Drop
« Reply #5 on: January 20, 2021, 12:04:18 pm »
@Sanmayce  welcome! I did not know or see demo of _ACCEPTFILEDROP, thanks! Hopefully we can drop in more than one file eventually.

FellippeHeitor

  • Guest
Re: A skeleton code for Text Scroller via Drag-and-Drop
« Reply #6 on: January 20, 2021, 12:06:45 pm »
Yeah, the whole drag/drop suite of commands is getting old already at this point (they were introduced in v1.3) - and yes, you can handle multiple files. Click the keywords below to read more about them:

Code: QB64: [Select]
« Last Edit: January 20, 2021, 12:07:50 pm by FellippeHeitor »

Offline Pete

  • Forum Resident
  • Posts: 2361
  • Cuz I sez so, varmint!
    • View Profile
Re: A skeleton code for Text Scroller via Drag-and-Drop
« Reply #7 on: January 20, 2021, 12:09:58 pm »
@bplus

This is a neat addition to the language. I have it in V. 1.3. Back in the day, I had to make my own routine. I dragged a copy of FreeBASIC in it once, by mistake, which created a memory incident. It returned an "Are you out of your mind," error.

Pete
Want to learn how to write code on cave walls? https://www.tapatalk.com/groups/qbasic/qbasic-f1/

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: A skeleton code for Text Scroller via Drag-and-Drop
« Reply #8 on: January 20, 2021, 12:14:18 pm »
@bplus

This is a neat addition to the language. I have it in V. 1.3. Back in the day, I had to make my own routine. I dragged a copy of FreeBASIC in it once, by mistake, which created a memory incident. It returned an "Are you out of your mind," error.

Pete

LOL

Yeah I am seeing this as nice substitute for expensive File Dialog! Would like to see demo of handling multiple files, something to play around with for sure!

FellippeHeitor

  • Guest
Re: A skeleton code for Text Scroller via Drag-and-Drop
« Reply #9 on: January 20, 2021, 12:14:56 pm »
All in the wiki 😉

Marked as best answer by Sanmayce on January 20, 2021, 06:45:56 pm

Offline NOVARSEG

  • Forum Resident
  • Posts: 509
    • View Profile
Re: A skeleton code for Text Scroller via Drag-and-Drop
« Reply #10 on: January 20, 2021, 10:50:02 pm »
Hi Sanmayce

I tried uncommenting the _LIMIT 30 in your code and it does work but it takes forever (just over 2 minutes) for the wheel to update. That is because there is usually tons of mouse x, y position data in the mouse buffer and LIMIT 30 is too slow to process that data. The wheel data is usually at the end of the x, y position data.

Actually the wheel and position data can be intermixed but when the wheel data is at the end of a large amount of position data,  there is this apparent delay in wheel update.

Even with no mouse position data in the buffer, the wheel response is pretty slow with _LIMIT 30

So try _LIMIT 500
« Last Edit: January 21, 2021, 12:40:13 am by NOVARSEG »

Offline Sanmayce

  • Newbie
  • Posts: 63
  • Where is that English Text Sidekick?
    • View Profile
    • Sanmayce's home
Re: A skeleton code for Text Scroller via Drag-and-Drop
« Reply #11 on: January 20, 2021, 11:38:27 pm »
Thank you very much guys, having found QB64 and this community/forum gladdened me, bigtime, for two days I feel as if being in happy old times.

My passion is text processing of huge English text, searching, decompressing, indexing them in order to ease quick n-gram requests i.e. to have spell-checkers, and ... phrase-checkers of English texts under the fingers.
C and QB64 are so instrumental in that regard, eager to pursue this dream of mine...

@SMcNeill

Thank you Steve, not only for you suggestion (which prompted me to revise my first pseudo-buggy attempt) but for useful sharings of yours. Showing different scenarios being handled is the best way to help others, such snippets/etudes are instrumental for sure.
The idea is to write a simplistic viewer working with the "heap" by using the QB64's memaloc()-like new functions instead of array of NON-FIXED length strings. Wanna try how the scroller behaves with 1GB file text loaded in RAM.
Your MEMUSAGE tool is cool, MUCH NEEDED, accessing Windows APIs has to be explored as you did (I have no experience in using APIs), some functionality has to be "stolen" from DLLs, wanna write first that exact viewer...

Welcome aboard, @Sanmayce! Cool to see you're already getting it going with several modern keywords as well! Looking forward to your future contributions.

Thank you man! Surely in future will share all my code along with my feedback.

Fellippe, I bend a knee before you. resurrecting QB is just awesome! Many beers I owe you.
As far as I recall, only said this once back, to another developer - a true master of coding compression in C.

Really enliked your presentation about 'InForm', please consider doing such reviews more often, at least not stopping them:

https://www.youtube.com/watch?v=S3D4zEUQ0sQ&list=PLD7-OthpyuXNbrB12Cl5_3vBpRtvN7CA8&index=5

Nice work with this Form Designer, wanna try it after some weeks, my tempo is slow but ongoing, a real fan here, that is.

My expertise is amateurish, I have been playing with search algorithms, and Windows (as far as Form Designer goes) not wanting to go into C++ and APIs, just played for a month or so with VisualStudio (ATL project) in order to make my GUI shell for invoking my console executables written in C. Just assigned some SHELL _HIDE like instance behind each button. The result: www.sanmayce.com/Downloads/_GW_(Bare-Minimum_2018-Mar-16).zip
It looks very nice on Windows XP, and so ugly with the new Windows 7+ schemes, therefore for more than 3 years I abandoned it, shame.

  [ Invalid Attachment ]  
  [ Invalid Attachment ]  
  [ Invalid Attachment ]  

Similar thing is what I want to write with QB64 - a simplistic text editor sensitive to all my textual processing tools - my textual madness is deep and constant, my wish is in the near future to have phrase sensitive functionality (giving statistics about English language n-grams generated by external tools) while hovering over this text window, both with cursor and mouse.
Simply, I am hell bent on making and sharing one 100% FREE lightweight (and thanks to QB64 portability) text assistant/sidekick/application in the near future.

Want to ask for possible way to load our own bitmap (from DOS times) fonts, saw that '_FONT 16' is default for SCREEN 0, if there is a way to load those fonts will bring additional retro flavor as they were very nice, sharing them, to take a look if interested:
 
 

@Sanmayce

Welcome. I like GUI the stuff, too. I've got a project I'm working on currently, posted over at the QBasic forum. Since you're an old-timer, do you remember that forum? Network54 used to host it. Now it's on Tapatalk. Mallord was the first admin, followed by Mac, and Mac turned it over to me, when he passed away in 2008. Anyway, I'm just curious if you recall it, or Pete's QBasic forum, or any of the others back in the day.

Pete

Thanks, will share some GUI of mine in the future, my Gallowwalker GUI, in the meantime you are welcome to see some of its functionality at:
https://github.com/Sanmayce/1gram/issues/1

As for the old forum, no, was not active in Internet for a long time, haven't seen it. Otherwise, I am a chatterbox :P

The idea is to have the first English Phrase-Checker - checking all n-grams (phrases of n words) of your text (the loaded into this QB64 assistant) against mega corpora of English n-grams, hundreds of millions strong!
 
DEjSDoTXkAQ71GH.jpg


@Sanmayce  welcome! I did not know or see demo of _ACCEPTFILEDROP, thanks! Hopefully we can drop in more than one file eventually.

Thank you, @bplus, I myself am uncovering new things on a daily basis, so many gaps ate there in my know-how.

Did a minor tweak (pseudo-bug fixage), rather add-on, now one can use the left button and "jump" on the desired line, along with scrolling with keys and the wheel:

Code: QB64: [Select]
  1. ' DragDropWheelScroller.bas
  2. ' written in QB64 v1.4 by Kaze, 2021-Jan-21
  3. ' Thanks go to the www.qb64.org/forum members for sharing useful excerpts/etudes
  4.  
  5. _TITLE "DragDropWheel"
  6. CONST RSHIFT& = 100303
  7. CONST LSHIFT& = 100304
  8.  
  9. XdimCOL = 100
  10. YdimROW = 44 ' ensure old laptops with 768pixels vertical will hold the whole window
  11. IF high& > 1000 THEN YdimROW = 60
  12. handle& = _NEWIMAGE(XdimCOL, YdimROW, 0)
  13. SCREEN handle&
  14.  
  15. '_FONT 16 'wish we could use the old 8x16 bitmap/raster fonts from DOS times...
  16.  
  17. ' Either one must be uncommented:
  18. '_AUTODISPLAY 'no need of refreshing
  19.  
  20. _ACCEPTFILEDROP 'enables drag/drop functionality
  21.  
  22. IF INSTR(LCASE$(COMMAND$), "/purple") THEN
  23.     COLOR 9, 0
  24.     COLOR 3, 0
  25.  
  26. PRINT "Current working directory path: "; CHR$(34); _CWD$; CHR$(34)
  27. PRINT "User's program calling path: "; CHR$(34); _STARTDIR$; CHR$(34)
  28. PRINT "Command line parameters sent when a program is started: "; CHR$(34); COMMAND$; CHR$(34)
  29. PRINT "_OS$="; _OS$
  30.  
  31. 'Y = CSRLIN 'save the row
  32. 'X = POS(0) 'save the column
  33.  
  34. filecount% = 0
  35. REDIM FileArray$(1000000) 'create dynamic array: 3880000 alocates 532MB - bigger values need 570+MB and give "Out Of Memory"
  36.  
  37. FOR i = 1 TO YdimROW
  38.     FileArray$(i) = ""
  39.  
  40. PRINT "Drag files from a folder and drop them in this window..."
  41. 'REDIM FileArray$(filecount%)
  42.  
  43. 'pressakey$ = INPUT$(1)
  44.  
  45. a$ = ""
  46.         'FOR i = 1 TO _TOTALDROPPEDFILES
  47.         'a$ = _DROPPEDFILE(i)
  48.         a$ = _DROPPEDFILE(1)
  49.         'NEXT'
  50.         _FINISHDROP 'If _FINISHDROP isn't called here then _TOTALDROPPEDFILES never gets reset.
  51.         'ELSE
  52.         'a$ = "Scroller.$$$"
  53.         'SHELL _HIDE "DIR /B *.* > Scroller.$$$"
  54.     END IF
  55.  
  56.     IF _FILEEXISTS(a$) THEN
  57.         OPEN a$ FOR INPUT AS #1
  58.         DO UNTIL EOF(1)
  59.             LINE INPUT #1, filename$ 'read entire text file line
  60.             filecount% = filecount% + 1
  61.             FileArray$(filecount%) = filename$
  62.         LOOP
  63.         CLOSE #1
  64.     END IF
  65.     _LIMIT 30
  66. LOOP WHILE a$ = ""
  67.  
  68. 'PRINT "Printing filenames in current directory... ";: PRINT LTRIM$(STR$(filecount%))
  69.  
  70. FOR i = 1 TO YdimROW 'filecount%
  71.     IF LEN(FileArray$(i)) >= XdimCOL THEN
  72.         FileArray$(i) = MID$(FileArray$(i), 1, XdimCOL)
  73.     ELSE
  74.         FileArray$(i) = FileArray$(i) + SPACE$(XdimCOL - LEN(FileArray$(i)))
  75.     END IF
  76.     LOCATE i, 1: PRINT FileArray$(i);
  77.  
  78. LOCATE 1, 1
  79. crx = POS(0)
  80. cry = CSRLIN
  81. crxOLD = crx
  82. cryOLD = cry
  83. LOCATE cry, crx, 1, 30, 31
  84.  
  85. IF INSTR(LCASE$(COMMAND$), "/purple") THEN
  86.     COLOR 8, 0
  87.     COLOR 0, 3
  88. PRINT FileArray$(cry);
  89.     IF _KEYDOWN(LSHIFT&) THEN PLAY "L8V2ff-"
  90.     IF _KEYDOWN(RSHIFT&) THEN PLAY "L8V2a-c-"
  91.     'LOCATE cry, crx, 1, 30, 31
  92.     key$ = INKEY$
  93.     'DO: a$ = INKEY$: LOOP UNTIL a$ <> "" ' prevent ASC empty string read error
  94.     IF key$ <> "" THEN
  95.         code% = ASC(key$):
  96.         IF code% THEN ' ASC returns any value greater than 0
  97.             SELECT CASE ASC(key$)
  98.                 CASE 65 TO 97: 'PRINT key$;
  99.                 CASE ASC("a") TO ASC("z"): 'PRINT key$;
  100.                 CASE 27: COLOR 7, 0: SYSTEM 'END
  101.             END SELECT
  102.         ELSE
  103.             SELECT CASE ASC(key$, 2)
  104.                 CASE 72: IF cry > 1 THEN cry = cry - 1 'up
  105.                 CASE 80: IF cry < YdimROW THEN cry = cry + 1 'down
  106.                 CASE 75: IF crx > 1 THEN crx = crx - 1 'left
  107.                 CASE 77: IF crx < XdimCOL THEN crx = crx + 1 'right
  108.             END SELECT
  109.         END IF
  110.     END IF
  111.     IF cryOLD <> cry THEN
  112.         'LOCATE cryOLD, crx, 1, 30, 31: COLOR 3, 0: PRINT FileArray$(cryOLD);
  113.         LOCATE cryOLD, 1, 1, 30, 31
  114.         IF INSTR(LCASE$(COMMAND$), "/purple") THEN
  115.             COLOR 9, 0
  116.         ELSE
  117.             COLOR 3, 0
  118.         END IF
  119.         PRINT FileArray$(cryOLD);
  120.         cryOLD = cry
  121.     ELSE 'it 'cry' could be changed by Mouse Wheel too, check it
  122.         AsIfItIsINKEY% = _MOUSEINPUT '      Check the mouse status
  123.         IF _MOUSEWHEEL = 1 THEN ' as if Down
  124.             IF cry < YdimROW THEN cry = cry + 1 'down
  125.         END IF
  126.         IF _MOUSEWHEEL = -1 THEN ' as if Up
  127.             IF cry > 1 THEN cry = cry - 1 'up
  128.         END IF
  129.         'Kinda trump the arrows and wheel with MOUSEmovement i.e. us having both the inverse(selected) line plus darklighting the current(under the mouse pointer) one
  130.         IF _MOUSEBUTTON(1) THEN
  131.             cry = _MOUSEY
  132.         END IF
  133.     END IF
  134.     'dummy me, the 2021-Jan-20 was not smoot friendly, should have updated here (not in the loop afterwards) i.e. _DISPLY shows two inversed lines, ugh [
  135.     IF cryOLD <> cry THEN
  136.         'LOCATE cryOLD, crx, 1, 30, 31: COLOR 3, 0: PRINT FileArray$(cryOLD);
  137.         LOCATE cryOLD, 1, 1, 30, 31
  138.         IF INSTR(LCASE$(COMMAND$), "/purple") THEN
  139.             COLOR 9, 0
  140.         ELSE
  141.             COLOR 3, 0
  142.         END IF
  143.         PRINT FileArray$(cryOLD);
  144.         cryOLD = cry
  145.     END IF
  146.     'dummy me, the 2021-Jan-20 was not smoot friendly, should have updated here (not in the loop afterwards) i.e. _DISPLY shows two inversed lines, ugh ]
  147.     'LOCATE cry, crx, 1, 30, 31: COLOR 0, 3: PRINT FileArray$(cry);
  148.     LOCATE cry, 1, 1, 30, 31
  149.     IF INSTR(LCASE$(COMMAND$), "/purple") THEN
  150.         COLOR 8, 0
  151.     ELSE
  152.         COLOR 0, 3
  153.     END IF
  154.     PRINT FileArray$(cry);
  155.     _DISPLAY
  156.     'DO WHILE INKEY$ <> "": LOOP ' have to clear the keyboard buffer
  157.     '_LIMIT 30 'commented because the wheel up/down was not working?!
  158.  
  159.  

 
WIndowsXP.png


Kinda want to revive the DOS functionality of my old QB project:

 
GW_r1+++_4-GrammingB_balloon.png

 
GW_r1+++_4-GrammingC_balloon.png
GAMERA06.GIF
* GAMERA06.GIF (Filesize: 29.52 KB, Dimensions: 740x420, Views: 479)
GAMERA07.GIF
* GAMERA07.GIF (Filesize: 24.61 KB, Dimensions: 740x420, Views: 514)
* DragDropWheelScroller.bas (Filesize: 9.49 KB, Downloads: 338)
GW_r1+++_4-GrammingA_balloon.png
* GW_r1+++_4-GrammingA_balloon.png (Filesize: 249.86 KB, Dimensions: 1256x738, Views: 611)
« Last Edit: January 20, 2021, 11:44:31 pm by Sanmayce »
He learns not to learn and reverts to what all men pass by.

FellippeHeitor

  • Guest
Re: A skeleton code for Text Scroller via Drag-and-Drop
« Reply #12 on: January 20, 2021, 11:43:42 pm »
Quote
Fellippe, I bend a knee before you. resurrecting QB is just awesome! Many beers I owe you.
As far as I recall, only said this once back, to another developer - a true master of coding compression in C.

Really enliked your presentation about 'InForm', please consider doing such reviews more often, at least not stopping them:

https ://www.youtube.com/watch?v=S3D4zEUQ0sQ&list=PLD7-OthpyuXNbrB12Cl5_3vBpRtvN7CA8&index=5

Nice work with this Form Designer, wanna try it after some weeks, my tempo is slow but ongoing, a real fan here, that is.

We all bend our knees before @Galleon, the guy who created QB64 in the first place. I'm barely part of the team. He does come around from time to time.

I'm so glad you enjoyed InForm! That's truly my code baby. Let me know if I can be of any assistance with it.

Offline Sanmayce

  • Newbie
  • Posts: 63
  • Where is that English Text Sidekick?
    • View Profile
    • Sanmayce's home
Re: A skeleton code for Text Scroller via Drag-and-Drop
« Reply #13 on: January 20, 2021, 11:53:39 pm »
We all bend our knees before @Galleon, the guy who created QB64 in the first place. I'm barely part of the team. He does come around from time to time.

I'm so glad you enjoyed InForm! That's truly my code baby. Let me know if I can be of any assistance with it.

Oh, I bend a knee the third time, then. VIVA @Galleon.
I can tell from your video, you are bona-fide QB fellow, indeed!
Excuse me for the previous messy post of mine, couldn't fit all the illustrative screenshots at once, that is what happens when many fellow members address a new fellow at once, likey-likey :P
He learns not to learn and reverts to what all men pass by.

Offline NOVARSEG

  • Forum Resident
  • Posts: 509
    • View Profile
Re: A skeleton code for Text Scroller via Drag-and-Drop
« Reply #14 on: January 21, 2021, 12:17:33 am »
Thanks Sanmayce


Quote
My passion is text processing of huge English text, searching, decompressing, indexing them in order to ease quick n-gram requests i.e. to have spell-checkers, and ... phrase-checkers of English texts under the fingers.
C and QB64 are so instrumental in that regard, eager to pursue this dream of mine...

You will like the fact that QB64 string size is over 2GB

Quote
25 years ago I wrote some original tools in QB45 + MASM functions

Did you ever use DOS interrupts . Ralf Brown interrupt list etc?