Help with putting specific text in specific places in a button

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10320
Joined: Wed May 06, 2009 2:28 pm

Re: Help with putting specific text in specific places in a button

Post by dunbarx » Wed Jan 22, 2020 7:41 pm

Richmond.

What Mark (always) said (says).
but, then, your script is inconsistent:
I tried to make it clear that my handler was in the card script. The OP stated he wanted the cursor to act over a large number of controls. That means card or higher.

Craig

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10099
Joined: Fri Feb 19, 2010 10:17 am

Re: Help with putting specific text in specific places in a button

Post by richmond62 » Wed Jan 22, 2020 7:57 pm

Craig.
I tried to make it clear that my handler was in the card script.
Well I owe you an apology there. 8)

Obviously if that is to be in the cardScript one has to use "target" rather than "me."

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10320
Joined: Wed May 06, 2009 2:28 pm

Re: Help with putting specific text in specific places in a button

Post by dunbarx » Wed Jan 22, 2020 8:39 pm

Richmond.

No harm, no fool.

Craig

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10320
Joined: Wed May 06, 2009 2:28 pm

Re: Help with putting specific text in specific places in a button

Post by dunbarx » Wed Jan 22, 2020 8:44 pm

Hi.
The only issue though is that sometimes pencil markings can be more than 6 digits...
So the markings could be a maximum of 9? Are they ever irregular, that is, not rectangular? And do they ever cover more than one of the 9-position squares?

Craig

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10099
Joined: Fri Feb 19, 2010 10:17 am

Re: Help with putting specific text in specific places in a button

Post by richmond62 » Wed Jan 22, 2020 9:53 pm

The only issue though is that sometimes pencil markings can be more than 6 digits
Stretch your fields.
-
Me3.png
-
although; from an aesthetic point of view . . . .
-
Suds.jpg
Suds.jpg (8.84 KiB) Viewed 6356 times
-
Always a bit of a tough one, sorting out the appearance once one has got the functionality in place. 8)
Attachments
Me three.livecode.zip
Here's the stack.
(1.25 KiB) Downloaded 191 times

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10320
Joined: Wed May 06, 2009 2:28 pm

Re: Help with putting specific text in specific places in a button

Post by dunbarx » Wed Jan 22, 2020 10:09 pm

Richmond.

I don't play sudoku, (I'd rather Scrabble) but I do not understand the "stretched" fields that contain 1-9 in a string. The second attachment you posted looks more normal. In the first one, how would the pencil markings work, or, in fact, how does one play at all?

I have some ideas on how to "set" those markings, but am no longer sure of the structure.

For the question about irregular markings, does this ever happen:
Screen Shot 2020-01-22 at 4.07.50 PM.png
Screen Shot 2020-01-22 at 4.07.50 PM.png (3.98 KiB) Viewed 6350 times
Craig

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10320
Joined: Wed May 06, 2009 2:28 pm

Re: Help with putting specific text in specific places in a button

Post by dunbarx » Wed Jan 22, 2020 10:10 pm

Ah.

Did you just take a shortcut and enclose the entire block of 9?

Craig

Opaquer
Posts: 247
Joined: Wed Aug 14, 2013 8:24 am

Re: Help with putting specific text in specific places in a button

Post by Opaquer » Wed Jan 22, 2020 10:36 pm

Hey guys, sorry for the late reply, I was asleep :-P

In terms of the target and me thing, that's very handy to know - will definitely have to implement it that way!

As for the markings, there can't be more than 9 - though finding a way to fit 9 in the corners/edge and 9 in the centre is proving to be difficult

To give a quick overview of pencil markings - people use them to see what numbers can go in which squares. For example, I might have a look at where the 4s can go in a 3x3 square and see that there's only 2 cells that it can go into. In that case, I'd put a pencil mark 4 for the two cells it can go into, and that way I know no matter what, one of those has to be a 4. If later on, I find another 4 in the sudoku, I can look back to the 3x3 grid and see if it narrows down which one of the cells the 4 can be in.

Unfortunately some people use "corner" pencil markings, which is what the 1-6 were in the original photo (and while it can technically go up to 9, that's probably quite rare, but knowing people, they'll do it), and they also use pencil markings in the centre of the cells to talk about row/column logic instead of 3x3 cell logic - so instead of finding out where a 4 can go in a 3x3 square, they'll find where it can go in an entire row/column.

In terms of fitting it all, I may have to just accept the fact I can't fit 18 digits into a cell and have some overlap. I might try the group of fields and see how that goes!

Hopefully that made sense - I can get some pictures once I'm at my computer

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10099
Joined: Fri Feb 19, 2010 10:17 am

Re: Help with putting specific text in specific places in a button

Post by richmond62 » Wed Jan 22, 2020 10:39 pm

Can you let us have some hand drawn mockup pictures or something?

With any luck you should have enough postings by now to upload something. :)

Opaquer
Posts: 247
Joined: Wed Aug 14, 2013 8:24 am

Re: Help with putting specific text in specific places in a button

Post by Opaquer » Thu Jan 23, 2020 4:34 am

I sure can! While I do have enough posts to upload something, I'm on my phone at work and can't upload anything unless I take a picture of it, which is quite inconvenient, unless I'm missing something :-P. Anyway, here's another link in the meantime :-P. https://imgur.com/6c9YlZX

So, the blue squares in the top right corner, I've found can only be a 3, so I use a pencil mark in the 2 available squares that can ba a 3 in that 3x3 section.

For the top left, I've found that an 8 can only be in the blue marked sqaures, and similarly for the marked squares in the bottom left 3x3 section. If I knew of other numbers that could go in those cells (or any others), I'd mark those too. For the top row, I know that in the empty cells there's a 5, 6 and 9 missing - I don't know where yet, so I've just put a pencil mark in the centre to show that those numbers can be anywhere in the row.

That's basically what I'm trying to achieve - make it so that people can do pencil markings on the corners or the centre of small squares to keep track of where numbers can go

Hopefully that made sense - if not, let me know!

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10099
Joined: Fri Feb 19, 2010 10:17 am

Re: Help with putting specific text in specific places in a button

Post by richmond62 » Thu Jan 23, 2020 8:34 am

Good morning from Bulgaria. 8)
-
6c9YlZX.jpg

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10099
Joined: Fri Feb 19, 2010 10:17 am

Re: Help with putting specific text in specific places in a button

Post by richmond62 » Thu Jan 23, 2020 8:41 am

Nothing like a picture for getting to the bottom of something.

So . . .

It would seem that you are looking for a grid of fields (9 x 9) each having the capacity to hold 3 digits
(probably more sensible to talk about digits than numbers).

The only problem would seem to be how, having chosen one of the three digits it should magically
expand in size:
-
suds.png
suds.png (20.71 KiB) Viewed 6260 times

Opaquer
Posts: 247
Joined: Wed Aug 14, 2013 8:24 am

Re: Help with putting specific text in specific places in a button

Post by Opaquer » Thu Jan 23, 2020 9:36 am

Hey Richmond

That's mostly it, but sometimes it's more than 3 digits. And in theory, if I had a group of fields, couldn't I also have another field that's in front of them all that is only visible once a number is chosen?

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10099
Joined: Fri Feb 19, 2010 10:17 am

Re: Help with putting specific text in specific places in a button

Post by richmond62 » Thu Jan 23, 2020 12:14 pm

I would be easy enough to have 2 fields layered on top of each other:

1. The one that takes the initial digits ( "f1TOP") on top of

2. The one that holds the final digit ("f1FINAL") decided on.

I can see a problem:

1. The end-user (game player) has to be able to enter their guess digits into field "f1TOP", so the field has to be set up to allow cursor and text insertion.
-
fieldSettings.png
-
2. Then the field settings have to, somehow be set differently so the end-user can select one of the digits, it is entered into field "f1FINAL" which is then set to the top layer.

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10320
Joined: Wed May 06, 2009 2:28 pm

Re: Help with putting specific text in specific places in a button

Post by dunbarx » Thu Jan 23, 2020 4:56 pm

Hi.

Try this sample stack. Only the topRight "cell" has functionality.

If you click in the center of the cell, you can enter a value.
If you click in the upper right of that cell, you can enter missing values.
If you click in the upper left of that cell, you can enter possible values.

This is all about user interface; it has to be fun and intuitive. Most of it is in the card script, with a little in the small fields in the corners of the topRight cell. You can see them if you choose the edit tool and click there.
SudokuTest.livecode.zip
(1.94 KiB) Downloaded 182 times
Craig

Post Reply