Liberty BASIC Community Forum
« Graphicbox code reduction ... HELP!!! »

Welcome Guest. Please Login or Register.
Feb 22nd, 2018, 12:33pm


Rules|Home|Help|Search|Recent Posts|Notification


« Previous Topic | Next Topic »
Pages: 1 2 3 4  Notify Send Topic Print
 veryhotthread  Author  Topic: Graphicbox code reduction ... HELP!!!  (Read 1744 times)
tsh73
Board Moderator

member is offline

Avatar

Anatoly (real name)


PM

Gender: Male
Posts: 1745
xx Re: Graphicbox code reduction ... HELP!!!
« Reply #45 on: May 5th, 2017, 07:39am »

on May 5th, 2017, 03:39am, Turtleman wrote:
To be a little more specific, once a textbox has been selected (colored cyan), it needs to accept a new typed in value that will remain once the textbox has been deselected.


It looks like Rod's code from Reply #39 does exactly that.

As for turning thing white again after editing is complete:
in Reply #39 it does so if you click on other edit field
But you can add stylebit'ed Default button along this (found on forum)
Code:
    Stylebits #main.default, _BS_DEFPUSHBUTTON, 0, 0, 0
    button #main.default,"OK",[type], UL, 180,  32,  28,  25
 
- just move it off screen
and call [removeinput] on Enter:
Code:
[type]     gosub [removeinput]
wait
 

now I wish it worked for TAB too, and jumped to correct next exditor...
User IP Logged

damned Dog in the Manger
Turtleman
Full Member
ImageImageImage


member is offline

Avatar




PM

Gender: Male
Posts: 187
xx Re: Graphicbox code reduction ... HELP!!!
« Reply #46 on: May 9th, 2017, 3:09pm »

Iím finally back after spending nearly 4 days upgrading the computer for an SSD, reinstalling a fresh OS, and reloading and configuring tons of software. (Oh, all the hype about SSDís is for real. What a tremendous improvement!)

So here I go begging for help again, made all the more difficult after being away for several days. Yes, ďgosub [removeinput]Ē clears the previous entry and returns to white. However, the same textbox can no longer be selected unless another textbox has been selected first. In any case, it would be great to be able to clear on a second mouse click to the same textbox, but I donít have a clue!
User IP Logged

Turtleman
Full Member
ImageImageImage


member is offline

Avatar




PM

Gender: Male
Posts: 187
xx Re: Graphicbox code reduction ... HELP!!!
« Reply #47 on: May 10th, 2017, 04:34am »

Have a ďCLEARĒ button that can return a cyan textbox to white, including the one just selected. Now, if I only figure out how to do it on another mouse click instead of a separate button.
User IP Logged

Rod
Global Moderator
ImageImageImageImageImage


member is offline

Avatar

Graphics = goosebumps!


PM

Gender: Male
Posts: 5665
xx Re: Graphicbox code reduction ... HELP!!!
« Reply #48 on: May 10th, 2017, 06:33am »

I'll ask again, why are you concerned about the color remaining cyan? The user is editing that box so it is colored cyan, if he wants to edit another box he will click that and it will turn cyan. If he wants to move on to something else he will close the window or click on an action button like "next play" or similar. If either of these events occur you may or may not be redrawing the box colors. So what is the real need to color the box white?


A textbox is a kinda dumb control, by that I mean it sits and takes input but tells us very little about what is happening to it. Typically an external event like a button click will tell us to go fetch the user input. So here we are using change of focus polling to mimic a button press event, up side is it makes a grid of textboxes act like a grid control, downside is it can't tell us the user is completely finished editing until the usual external button event is triggered. No way round that. So if you can live with the color remaining you have a working solution.

« Last Edit: May 10th, 2017, 06:40am by Rod » User IP Logged

Turtleman
Full Member
ImageImageImage


member is offline

Avatar




PM

Gender: Male
Posts: 187
xx Re: Graphicbox code reduction ... HELP!!!
« Reply #49 on: May 10th, 2017, 06:43am »

A new number typed into a cyan textbox only gets substituted for the old value AFTER the textbox returns to white. It works fine if the new ďCLEARĒ button is pressed, but it would be more convenient to simply click the same textbox. Perhaps hitting a carriage return would work, which is what Iím trying now.

I haven't even tried putting in the rest of the code, such as turning a textbox yellow (just as an indicator) when selected in the code. I hope I'm not going down another blind alley.
User IP Logged

Turtleman
Full Member
ImageImageImage


member is offline

Avatar




PM

Gender: Male
Posts: 187
xx Re: Graphicbox code reduction ... HELP!!!
« Reply #50 on: May 10th, 2017, 06:48am »

Maybe I should give up on textboxes and use graphicboxes? It just seems that textboxes make it easier for entering new values. Very confused!
User IP Logged

Rod
Global Moderator
ImageImageImageImageImage


member is offline

Avatar

Graphics = goosebumps!


PM

Gender: Male
Posts: 5665
xx Re: Graphicbox code reduction ... HELP!!!
« Reply #51 on: May 10th, 2017, 1:31pm »

Quote:
A new number typed into a cyan textbox only gets substituted for the old value AFTER the textbox returns to white.


From the users perspective the cyan textbox takes the change immediately. The fact that you as the programmer take the cyan value and save it to the white textbox on a change of event is completely hidden from the user.

So I say again, why does it matter the box remains cyan. I think you have invented a non existent hurdle.

Moving to graphicbox solution will not remove this programming flow issue.

« Last Edit: May 10th, 2017, 1:33pm by Rod » User IP Logged

Turtleman
Full Member
ImageImageImage


member is offline

Avatar




PM

Gender: Male
Posts: 187
xx Re: Graphicbox code reduction ... HELP!!!
« Reply #52 on: May 10th, 2017, 1:47pm »

Iíve been playing with the graphicbox approach since my last post, and for whatever reason, the new typed in value is immediately seen! That isnít the case with the textbox approach, but thereís probably something else going on. Looking ahead (and knowing that Iíll have to selectively color a textbox yellow), Iím wondering if that may present other hurdles. Itís really hard to know which approach to go with, so I guess Iíll continue trying both for the time being.

No, it probably wouldnít matter if a textbox remains colored; but as already stated, it could get confusing when selected textboxes have to turn yellow. More than the merits of the cyan color remaining or not, Iím just as interested in learning how to structure the code to hide it. Iím sure anxious to get this routine nailed down and move onto the rest of the program. Thanks a bunch for your continued help!
« Last Edit: May 10th, 2017, 4:30pm by Turtleman » User IP Logged

Rod
Global Moderator
ImageImageImageImageImage


member is offline

Avatar

Graphics = goosebumps!


PM

Gender: Male
Posts: 5665
xx Re: Graphicbox code reduction ... HELP!!!
« Reply #53 on: May 11th, 2017, 03:29am »

Quote:
the new typed in value is immediately seen! That isnít the case with the textbox


What do you mean? If the cyan box is in view any edits are immediately visible. If that is not the case in your code you need to debug that.

Or do you mean that the cyan box value is not saved to the array or white textbox until the focus changes?

To lessen the confusion you would do better to have a small extract of runnable code where you can show us what does not work as you expect. If we can discuss specific code you can get specific targeted help.
User IP Logged

Turtleman
Full Member
ImageImageImage


member is offline

Avatar




PM

Gender: Male
Posts: 187
xx Re: Graphicbox code reduction ... HELP!!!
« Reply #54 on: May 12th, 2017, 05:09am »

May have it figured out! I had forgotten from previous attempts that the contents entered into a selected cyan-colored textbox needs to be read and substituted for whatever is contained in the same rowís white textbox. Theyíre two entirely different animals - DUH! Maybe I can get the textbox approach working after all. Thanks for all the help; Iíve learned a lot and will report back
User IP Logged

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

Rules|Home|Help|Search|Recent Posts|Notification

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