Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
I want it to work so bad....
#11
A bit more deep...

in some way the routine of "vs GUI" MainRoutine is the cause of the problem!

if you REM it from the code and run F5 you got a working program... except that you must manage manually the button for keyboard and mouse.

At start I have thought that in some way that SUB modifies the screenimage(1), but it is clear that it stucks on itself and also an EXIT SUB does not works.

Welcome to the Mystery Valley in QB64!
Reply
#12
So digging through a bit, I have made some progress. The GUI library takes control, not only with mouse events but also with _display so reenabling _autodisplay fixed the issue with the screen not showing yet stepping through still worked and CheckMenu as well to the DO/LOOP. This was never an issue when MainRouter was originally made to run non-stop once called. Seems I can use one or the other at a time in a particular window, just not together well, keyboard shortcuts (of the menu bar) work with the GUI, just not with the mouse (still digging through it...)

Adding:
 
Code: (Select All)
MainRouter:
Do
    Menu% = CHECKMENU%(True)
    ....
Loop until CompleteFlag 'Made true by BtnClickEvent sub in main
_autodisplay
CompleteFlag = False


So, 1/2 the battle solved.

Now, they don't play well together but using the GUI as pop-up window (without a menu bar at top) might be a happy compromise as well. I originally went with the GUI library because I am to unable to easily change the menu ribbon once made. I may keep digging to see if I can help these two wonderful resources play better together (it is what us teachers do anyhow Big Grin )

Thanks for the suggestions and pointing out some of my other mistakes that could have cause headaches further down the stretch. And if anyone else has an insight into why, feel free to share (updated code w/o the .exe this time)! Thank you again Cool


Attached Files
.zip   Updated.zip (Size: 555.61 KB / Downloads: 37)
Reply
#13
@NasaCow

I was thinking about what TempodiBasic wrote and realized last night it's a piece of cake to use a list box just like a menu!

Just read the item in the selectItem event and do what you would do for selecting a menu Item. I remember one time making a calculator solely from a list box control! Menus and buttons both can be done from a list box.

TempodiBasic also brought up an interesting thought, you do know how to write code for an event? I left a manual? 

Anyway you are fighting city hall with two systems wanting control of mouse and keypress events.

Have you thought of building different GUI apps (.exes) and then jobbing out to them from a central menu app, that way you can have both systems and keep them separate for mouse control.

Update: now you've done it, I am trying a gradebook app with GUI ;-))
b = b + ...
Reply
#14
@NasaCow
_AutoDisplay  !!!
yep! Good Shoot!
I have never thought about the control of the output to screen
fine
it works if I put it (_autodisplay) after MainRoutine  but it doesn't work if I put it in the BtnClickEvent!

...
mouse and keyboard inputs...as Bplus suggests you can write a simple FirstMainRoutine in which mouse and keyboard bring their input and following the cohordination between hot keys and the  events of application , more the click of mouse and the event programming put in scene.
It is sure that buttons and menu are not overlapping themselves.

where is the mouse? MenuArea? activate menu event manager.  Button or other GUI items? Activate GUI event manager?
Using comboKey with no duplication you can do the same with keyboard.
Again good luck.

@Bplus
GUI manual + GUI application for examples is a good add on for putting in evidence "vs GUI" library.
Who can do this better than its creator?

PS:
I apoligize for my bad nigthly english with many mistakes!
Reply
#15
Yeah TempodiBasic I do have a manual of sorts including change log called: b+ Very Simple GUI.txt Smile

OK I finally got the data entry bas file going in preparation for GUI. I made up a: PE Forum - Class.txt list in a WP to start.
I used that list to sketch out my vision of a Gradebook and then I made a Gradebook Data Entry.bas to go over details of how to work lines for List box and saves to .dat file.

I wrote Class Notes.txt to explain some stuff more and there is one GUI app for browsing files and folders to get a filename in this case the Class.txt file for list of name of class we are recording grades, actually scores from 1 to 100. Get 1 point just for showing up and getting your name right. Needed that to distinguish from test scores not filled in yet in the dat file lines.

So here is the package I made to prepare to convert to GUI but really, do we have to? It's working pretty nice already! Smile

Source code for get_Filename.exe is in sub folder for you to compile but I use SHELL to call it from inside demo bas files and I don't know if that works for Linux folks. You folks will have to plug in your own version of that line I think?

Here's a screen shot of the Sketch:
   
Wow! JRace has a 0, that shouldn't happen in random generated scores I made for Gradebook Data Entry.bas file, I think. It did find correct ave for 5 not 4 but I didn't have to worry about how many tests to average for Sketch demo. I sure did when loading and editing data from file!

get_Filename in action with proper file highlighted in List box, just click the "Use This File" button.
   


Attached Files
.zip   Gradebook prep for GUI.zip (Size: 1.91 MB / Downloads: 44)
b = b + ...
Reply
#16
Guess I should have left some columns (scores for given test) empty instead of filling in all 10 but it can rewrite all 10 columns with different numbers.

Basically I am thinking a teacher gives x amount of tests over a period of time and adds up and averages for final grade.
Anything else?

So what do we want to menu? Loading different _____ - Class.txt files for different classes of course, what else? 

Editing with GUI is sure going to be a challenge to make easier to use than what I have now.
b = b + ...
Reply
#17
Looks like Dav's the smartest guy on the boards. My grade didn't even show up. Someone must have left it in the basement, again.

Pete
Reply
#18
(11-26-2022, 03:14 AM)bplus Wrote: Wow! JRace has a 0....

Integer rollover.  Happened to me all the time in school.  At least, that's how I explained my grades to my parents.
Reply
#19
(11-26-2022, 06:42 PM)JRace Wrote:
(11-26-2022, 03:14 AM)bplus Wrote: Wow! JRace has a 0....

Integer rollover.  Happened to me all the time in school.  At least, that's how I explained my grades to my parents.



ROFL! +1. I used the old dog ate my report card. Trouble was, we didn't own a dog.
Reply
#20
(11-26-2022, 05:37 PM)Pete Wrote: Looks like Dav's the smartest guy on the boards. My grade didn't even show up. Someone must have left it in the basement, again.

Pete

Oh hey Mark remembers:
1. you can resize Console Window
2, you can highlight and Ctrl+C to copy text to _Clipboard

Now use code box for that paste and display and maybe Pete won't feel so low
Code: (Select All)
          a740g    70    53    57    28    30                                 238    48
          aurel    77     1    76    81    70                                 305    61
         BDS107     4    41    86    79    37                                 247    49
      bert22306    96    87     5    94    36                                 318    64
          bplus    52    76     5    59    46                                 238    48
       BSpinoza    29    62    64    26    27                                 208    42
      CharlieJV    82    82    58    98    91                                 411    82
        ChiaPet    22    69    98    24    53                                 266    53
        Coolman    10    99    67     1    57                                 234    47
        DANILIN    10    10    79    28     4                                 131    26
            Dav    29    38    30    94    97                                 288    58
           dbox    40    27    16    16    64                                 163    33
       dcromley    41    41    71    32    63                                 248    50
        Dimster    20    18    58     8    45                                 149    30
        Doppler    90    26    78    37    28                                 259    52
    DSMan195276    91    63    62    42     9                                 267    53
       eoredson    56    69    91    83     2                                 301    60
       euklides    54    91    43    67    50                                 305    61
           Fifi    51    46    35    40    26                                 198    40
        hanness     5    24    97     6    39                                 171    34
           Jack    36    48    15    47    25                                 171    34
James D Jarvis    62    54    15    93    65                                 289    58
      james2464    50    39    10    78    45                                 222    44
       johnno56    75    59    83     1    21                                 239    48
          JRace     7    10    33    12     0                                  62    12
    justsomeguy    53    65    54    82     8                                 262    52
    Kernelpanic    19    67    45    35    14                                 180    36
        Keybone    70    92    53     8    75                                 298    60
       madscijr    40    46    49    20    32                                 187    37
       MasterGy     9    58    16    92     9                                 184    37
       mdijkens    44    27    87    75    27                                 260    52
      mnrvovrfc    67    25     8     3    32                                 135    27
        NasaCow    79    29    23    48    25                                 204    41
       OldMoses    34     4    48    20    86                                 192    38
           Pete    58    75    92    33    54                                 312    62
           Petr     8    63    41    96    11                                 219    44
    PhilOfPerth    92    62    34    14    47                                 249    50
       RhoSigma    21    99    13     2    34                                 169    34
        Richard    54    92    53    40    84                                 323    65
           RNBW    82    67    72    99    33                                 353    71
      SierraKen    49    41    69    17    42                                 218    44
       SMcNeill    54    81    54    42    50                                 281    56
       Spriggsy    22    61    48    68    88                                 287    57
         Stuart    37    30    29    15    52                                 163    33
   TempodiBasic    22    58    36    87    47                                 250    50
   TerotRedhand    19    68    74    61    78                                 300    60
   TerryRitchie    16    80    20    95     6                                 217    43
            Tim     6    79    37    46    11                                 179    36
          vince    11    17     4    71    53                                 156    31


LOL @JRace now I know how you get the extra points to roll over 100, so yours should be 112.

BTW I forgot to mention I WAS using INPUT # to read file lines from dat file and for life of me could not figure why the right aligned names were all trimmed? Screwing up needed predictable layout of test scores,yikes!
Turns out INPUT #file Trims the file line!!  I had to use Line Input # instead to preserve leading spaces for right aligned names. Just noticed Jarvis is off by one.

Update: OK Line Input # fixed that one too! Edited the Sketch Output from Console.
Update: what!?? OK that's just some freaky problem with this forum editor!
b = b + ...
Reply




Users browsing this thread: 1 Guest(s)