How to change height and width of field to user preference

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

Post Reply
samjith
Posts: 85
Joined: Tue Mar 31, 2015 10:09 am

How to change height and width of field to user preference

Post by samjith » Wed Oct 28, 2015 8:10 am

Hi,

How to change height and width of a field to user preference? by mousestilldown handler. etc



Thanks
Samjith

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4172
Joined: Sun Jan 07, 2007 9:12 pm

Re: How to change height and width of field to user preferen

Post by bn » Wed Oct 28, 2015 8:51 am

Hi Samjith,

could you please describe in detail what you want.

Is it a one time change, is it a fixed change, is the user doing this "all the time" why would the user want to change etc. Is the field open for typing or is it a locked field?

All this is important to understand what you want.

Kind regards
Bernd

samjith
Posts: 85
Joined: Tue Mar 31, 2015 10:09 am

Re: How to change height and width of field to user preferen

Post by samjith » Wed Oct 28, 2015 9:28 am

Hi Bernd,

I wish to creating a text editor, that can have features like "split window",etc as in vim editor
when we split the main field, then, shows 2 field with same size (size:- 1 field + 2 field = size of main field).
if we change the width of first field by the user, then the second field automatically adjust.
Is it a one time change, is it a fixed change, is the user doing this "all the time" why would the user want to change etc. Is the field open for typing or is it a locked field?
The user can change height/width of a field by mouse
The user want to change field size for better handling
The field is not locked, open for typing

I know it is very difficult to understand what i meant, because of my bad english.

Thanks,
Samjith

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

Re: How to change height and width of field to user preferen

Post by dunbarx » Wed Oct 28, 2015 3:02 pm

Hi.

A few ways to do this. A table field, where you adjust the tabStops to show either one column or two (or more?). A dataGrid, where you change its "native" properties in much the same manner. Or, as you first mentioned, two separate fields that can be managed as a pair, where one is shown or hidden, their widths adjusting as you wish. They can sync together if they need to scroll. This is simple to do.

Which route you take may be a matter of style, but if you told more about your requirements, one of the solutions might suddenly become the best one.

Craig Newman

Klaus
Posts: 14199
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: How to change height and width of field to user preferen

Post by Klaus » Wed Oct 28, 2015 3:12 pm

Namaste Samjith,

I think you are looking for something like this, see attachment, that may get you started.


Best

Klaus
Attachments
fields_resize1.rev.zip
(1.36 KiB) Downloaded 233 times

samjith
Posts: 85
Joined: Tue Mar 31, 2015 10:09 am

Re: How to change height and width of field to user preferen

Post by samjith » Thu Oct 29, 2015 12:33 pm

Hi Klaus,

Thanks for the stack, really great.

I am attaching a stack, to spilt window (horizontally, vertically) and delete windows
But some bug in delete windows because i did this with the help of "rect" property

Please go through the stack,
Could you tell me how to implement this buttons inside the attached stack?

or any more way to do this?

I think, now you can understand what i really want to do.

You are great.

Thanks,
Samjith
Attachments
SPlit.zip
(1.79 KiB) Downloaded 225 times

Klaus
Posts: 14199
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: How to change height and width of field to user preferen

Post by Klaus » Thu Oct 29, 2015 2:15 pm

Hi samjith,

hm, your stack is completely different than mine :D
I had the impression that you want to let the user resize existing fields!

Problem is, that you are using "the selectedfield", if no field is selected/has focus
then your script will not work as exspected.

Maybe you could manage a list of IDs of the newly created field(s) and use that list
to delete one or more fields when the user clicks your "delete" button?


Best

Klaus

Post Reply