Re: formattedheight and formattedwidth

2011-06-27 Thread Richard Gaskin

Pete wrote:


OK I see what you mean about the formatted versions of height/width.  The
straight height and width properties don't seem to come anywhere close to
working even allowing for menu bar issues (I'm on OS X). They set the
height/width to what they were for the previous card opened in the stack,
not the current card.


This thread confuses me, since the height and width properties of a card 
object cannot be set at all.


A card is merely a container for controls inside the stack, allowing 
multiple sets of controls within a given window.  But the card always 
fills the stack, so changing the size of the stack will change the size 
of the card, but the size of the card itself cannot be set 
independently. Indeed, if it could what would happen to the area beyond 
the edges of a card which is smaller than the window displaying it?


AFAIK, there's only one exception to the general rule that the card size 
will always be the same as the stack size:  if the stack has a menubar 
defined, its editMenus property is false (the default), and it's 
currently running under OS X.


Since OS X has a global menu bar, the stack's menubar is scrolled out of 
view and the size of the stack is automatically cropped by the height of 
the menubar group.


In that case, the height of the card will be the stack height + the 
height of the menubar group, and the card width will remain the same as 
the stack's width.


Aside from that one set of circumstances on OS X, the card size should 
always reflect the stack size, and even on OS X with a menubar the stack 
size still governs the card size, the only difference being the height 
of the menubar group.


So if you want to change the size of the window, just change the size of 
the stack.


If you don't want to change the size of the window, what is the goal of 
attempting to change the card size?


--
 Richard Gaskin
 Fourth World
 LiveCode training and consulting: http://www.fourthworld.com
 Webzine for LiveCode developers: http://www.LiveCodeJournal.com
 LiveCode Journal blog: http://LiveCodejournal.com/blog.irv

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: formattedheight and formattedwidth

2011-06-27 Thread Pete
I am changing the stack size.  Each card in the stack in question needs to
have a different height and width dimension in order for all its controls to
be visible and, as you rightly point out, that has to be done by setting the
height and width properties of the stack, not the card.

I had initially inserted lines of code in the preOpenCard handler for each
individual card that set the height and width of the stack to specific
numbers.  But if I changed the design of the card or added a new card, I had
to change those numbers or remember to set the stack height and width so I
started looking for a generic method which I could put in the stack script
and I'd never have to worry about changing it again.

The formattedheight and formattedwidth properties ended up being the way to
do it, suitably adjusted to account for margins on each side of the card.
 The code I now use is:

set the height of this stack to the formattedheight of this card + 20
set the width of this stack to he formattedwidth of this card + 20

That works for any card in the stack as long as I make sure that the top let
control is positioned 10 pixels from the top and 10 pixels from the left
edge.

Hope that clears up the confusion.

Pete
Molly's Revenge http://www.mollysrevenge.com




On Mon, Jun 27, 2011 at 7:27 AM, Richard Gaskin
ambassa...@fourthworld.comwrote:

 Pete wrote:

  OK I see what you mean about the formatted versions of height/width.  The
 straight height and width properties don't seem to come anywhere close to
 working even allowing for menu bar issues (I'm on OS X). They set the
 height/width to what they were for the previous card opened in the stack,
 not the current card.


 This thread confuses me, since the height and width properties of a card
 object cannot be set at all.

 A card is merely a container for controls inside the stack, allowing
 multiple sets of controls within a given window.  But the card always fills
 the stack, so changing the size of the stack will change the size of the
 card, but the size of the card itself cannot be set independently. Indeed,
 if it could what would happen to the area beyond the edges of a card which
 is smaller than the window displaying it?

 AFAIK, there's only one exception to the general rule that the card size
 will always be the same as the stack size:  if the stack has a menubar
 defined, its editMenus property is false (the default), and it's currently
 running under OS X.

 Since OS X has a global menu bar, the stack's menubar is scrolled out of
 view and the size of the stack is automatically cropped by the height of the
 menubar group.

 In that case, the height of the card will be the stack height + the height
 of the menubar group, and the card width will remain the same as the stack's
 width.

 Aside from that one set of circumstances on OS X, the card size should
 always reflect the stack size, and even on OS X with a menubar the stack
 size still governs the card size, the only difference being the height of
 the menubar group.

 So if you want to change the size of the window, just change the size of
 the stack.

 If you don't want to change the size of the window, what is the goal of
 attempting to change the card size?

 --
  Richard Gaskin
  Fourth World
  LiveCode training and consulting: http://www.fourthworld.com
  Webzine for LiveCode developers: http://www.LiveCodeJournal.com
  LiveCode Journal blog: 
 http://LiveCodejournal.com/**blog.irvhttp://LiveCodejournal.com/blog.irv


 __**_
 use-livecode mailing list
 use-livecode@lists.runrev.com
 Please visit this url to subscribe, unsubscribe and manage your
 subscription preferences:
 http://lists.runrev.com/**mailman/listinfo/use-livecodehttp://lists.runrev.com/mailman/listinfo/use-livecode


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: formattedheight and formattedwidth

2011-06-27 Thread Bob Sneidar
Another way to do this is to have an object like a graphic on each card the 
size you want the card to be. You could put a handler in the object so that 
right clicking on it popped a menu, allowing you to select some pre-set sizes 
for the card, or make a custom size. Once selected, the graphic object could be 
sized appropriately, and then you could set the stack size to the formatted 
height and formatted width. The object size itself would be the remembering. 

If you already have a graphic object for your background pattern all the 
better. To prevent end users of your app (if there will be some) from doing the 
same thing, make a stack script that sets a property for devmode or something, 
and set it to false before compiling your stack. Check the value of the 
property before allowing the right-click to pop the menu. 

I think that is how I would do it. 

Bob


On Jun 27, 2011, at 9:15 AM, Pete wrote:

 I am changing the stack size.  Each card in the stack in question needs to
 have a different height and width dimension in order for all its controls to
 be visible and, as you rightly point out, that has to be done by setting the
 height and width properties of the stack, not the card.
 
 I had initially inserted lines of code in the preOpenCard handler for each
 individual card that set the height and width of the stack to specific
 numbers.  But if I changed the design of the card or added a new card, I had
 to change those numbers or remember to set the stack height and width so I
 started looking for a generic method which I could put in the stack script
 and I'd never have to worry about changing it again.
 
 The formattedheight and formattedwidth properties ended up being the way to
 do it, suitably adjusted to account for margins on each side of the card.
 The code I now use is:
 
 set the height of this stack to the formattedheight of this card + 20
 set the width of this stack to he formattedwidth of this card + 20
 
 That works for any card in the stack as long as I make sure that the top let
 control is positioned 10 pixels from the top and 10 pixels from the left
 edge.
 
 Hope that clears up the confusion.
 
 Pete
 Molly's Revenge http://www.mollysrevenge.com
 
 
 
 
 On Mon, Jun 27, 2011 at 7:27 AM, Richard Gaskin
 ambassa...@fourthworld.comwrote:
 
 Pete wrote:
 
 OK I see what you mean about the formatted versions of height/width.  The
 straight height and width properties don't seem to come anywhere close to
 working even allowing for menu bar issues (I'm on OS X). They set the
 height/width to what they were for the previous card opened in the stack,
 not the current card.
 
 
 This thread confuses me, since the height and width properties of a card
 object cannot be set at all.
 
 A card is merely a container for controls inside the stack, allowing
 multiple sets of controls within a given window.  But the card always fills
 the stack, so changing the size of the stack will change the size of the
 card, but the size of the card itself cannot be set independently. Indeed,
 if it could what would happen to the area beyond the edges of a card which
 is smaller than the window displaying it?
 
 AFAIK, there's only one exception to the general rule that the card size
 will always be the same as the stack size:  if the stack has a menubar
 defined, its editMenus property is false (the default), and it's currently
 running under OS X.
 
 Since OS X has a global menu bar, the stack's menubar is scrolled out of
 view and the size of the stack is automatically cropped by the height of the
 menubar group.
 
 In that case, the height of the card will be the stack height + the height
 of the menubar group, and the card width will remain the same as the stack's
 width.
 
 Aside from that one set of circumstances on OS X, the card size should
 always reflect the stack size, and even on OS X with a menubar the stack
 size still governs the card size, the only difference being the height of
 the menubar group.
 
 So if you want to change the size of the window, just change the size of
 the stack.
 
 If you don't want to change the size of the window, what is the goal of
 attempting to change the card size?
 
 --
 Richard Gaskin
 Fourth World
 LiveCode training and consulting: http://www.fourthworld.com
 Webzine for LiveCode developers: http://www.LiveCodeJournal.com
 LiveCode Journal blog: 
 http://LiveCodejournal.com/**blog.irvhttp://LiveCodejournal.com/blog.irv
 
 
 __**_
 use-livecode mailing list
 use-livecode@lists.runrev.com
 Please visit this url to subscribe, unsubscribe and manage your
 subscription preferences:
 http://lists.runrev.com/**mailman/listinfo/use-livecodehttp://lists.runrev.com/mailman/listinfo/use-livecode
 
 
 ___
 use-livecode mailing list
 use-livecode@lists.runrev.com
 Please visit this url to subscribe, unsubscribe and manage your subscription 
 preferences:
 http://lists.runrev.com

Re: formattedheight and formattedwidth

2011-06-26 Thread Pete
Thanks.  I guess the dictionary is misleading (yet again) when it says:

  If you specify a card or group, the *formattedHeight* reports the
height of a rectangle that includes all objects in that card or group whose
visible property is true.



I tried this:


set the height of this stack to the height of this card
set the width of this stack to the width of this card


Is  that what you meant? That sometimes works and sometimes isn't close.


Pete
Molly's Revenge http://www.mollysrevenge.com




On Sat, Jun 25, 2011 at 7:04 PM, J. Landman Gay jac...@hyperactivesw.comwrote:

 On 6/25/11 2:17 PM, Pete wrote:

 I have a number of cards in the same substack that need to be displayed
 with
 different heights and widths.  In the preOpenStack handlerr, I have:

 set the height of this stack to the formattedheight of this card
 set the width of this stack to the formattedwidth of this card

 The height and width end up several pixels short of what they need to be.
  Adding 10 to the fomattedheight and 20 to the formattedwidth makes things
 about right, but


 Use the height and width, not the formattedHeight and formattedWidth. The
 formatted measurements only include the smallest area that encompasses all
 the visible objects objects. If the card objects don't touch all four sides,
 the formatted measurements will be smaller than the card measurements.

 --
 Jacqueline Landman Gay | jac...@hyperactivesw.com
 HyperActive Software   | http://www.hyperactivesw.com

 __**_
 use-livecode mailing list
 use-livecode@lists.runrev.com
 Please visit this url to subscribe, unsubscribe and manage your
 subscription preferences:
 http://lists.runrev.com/**mailman/listinfo/use-livecodehttp://lists.runrev.com/mailman/listinfo/use-livecode


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: formattedheight and formattedwidth

2011-06-26 Thread J. Landman Gay

On 6/26/11 2:52 PM, Pete wrote:

Thanks.  I guess the dictionary is misleading (yet again) when it says:

   If you specify a card or group, the *formattedHeight* reports the
height of a rectangle that includes all objects in that card or group whose
visible property is true.


It seems accurate to me. The formatted measurement is the amount of 
space occupied by all visible objects on the card. It is calculated from 
the smallest rectangle that will enclose all of them. It does not 
include any empty borders around that area.



I tried this:


set the height of this stack to the height of this card
set the width of this stack to the width of this card


Is  that what you meant? That sometimes works and sometimes isn't close.


Yes, that's what I meant, assuming you want to set the window to same 
size as the card. If you are on OS X and you have a menu bar set, the 
top of the card will be scrolled out of view, so the height of the card 
will actually be taller than what you see before you change the size. If 
you are getting extra space at the bottom of the window then that's 
probably why. If you are on Windows then the card and window height 
should match up without any differences.


--
Jacqueline Landman Gay | jac...@hyperactivesw.com
HyperActive Software   | http://www.hyperactivesw.com

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: formattedheight and formattedwidth

2011-06-26 Thread Pete
OK I see what you mean about the formatted versions of height/width.  The
straight height and width properties don't seem to come anywhere close to
working even allowing for menu bar issues (I'm on OS X). They set the
height/width to what they were for the previous card opened in the stack,
not the current card. I've tried this in preOpenStack and preOpenCard so
maybe this card in the prewOpen handlers is still set to the last card
opened since this one hasn't been opened yet?

I think I will have to use the formatted height and width and be consistant
about how much room is around the borders of the controls on each card.

Pete
Molly's Revenge http://www.mollysrevenge.com




On Sun, Jun 26, 2011 at 3:55 PM, J. Landman Gay jac...@hyperactivesw.comwrote:

 On 6/26/11 2:52 PM, Pete wrote:

 Thanks.  I guess the dictionary is misleading (yet again) when it says:

   If you specify a card or group, the *formattedHeight* reports the
 height of a rectangle that includes all objects in that card or group
 whose
 visible property is true.


 It seems accurate to me. The formatted measurement is the amount of space
 occupied by all visible objects on the card. It is calculated from the
 smallest rectangle that will enclose all of them. It does not include any
 empty borders around that area.


  I tried this:


 set the height of this stack to the height of this card
 set the width of this stack to the width of this card


 Is  that what you meant? That sometimes works and sometimes isn't close.


 Yes, that's what I meant, assuming you want to set the window to same size
 as the card. If you are on OS X and you have a menu bar set, the top of the
 card will be scrolled out of view, so the height of the card will actually
 be taller than what you see before you change the size. If you are getting
 extra space at the bottom of the window then that's probably why. If you are
 on Windows then the card and window height should match up without any
 differences.


 --
 Jacqueline Landman Gay | jac...@hyperactivesw.com
 HyperActive Software   | http://www.hyperactivesw.com

 __**_
 use-livecode mailing list
 use-livecode@lists.runrev.com
 Please visit this url to subscribe, unsubscribe and manage your
 subscription preferences:
 http://lists.runrev.com/**mailman/listinfo/use-livecodehttp://lists.runrev.com/mailman/listinfo/use-livecode


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: formattedheight and formattedwidth

2011-06-26 Thread Robert Brenstein

On 26.06.2011 at 17:42 Uhr -0700 Pete apparently wrote:


I think I will have to use the formatted height and width and be consistant
about how much room is around the borders of the controls on each card.



If your cards vary in size but are static, that is not changed 
dynamically by users, then you could save the desired width and 
height of each card in custom properties and resize each card in 
preopencard.


Robert

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: formattedheight and formattedwidth

2011-06-26 Thread Pete
Yep, that's what I was doing initially but was looking for a way to make it
happen without actually knowing the height and width.

I think I have this working now.  I made sure that the topmost control on
each card always had it's topleft set to 10,10 , then I add 20 to each of
the formatted height and formatted width during preOpenCard. That seems to
work just fine.

Pete
Molly's Revenge http://www.mollysrevenge.com




On Sun, Jun 26, 2011 at 6:12 PM, Robert Brenstein r...@robelko.com wrote:

 On 26.06.2011 at 17:42 Uhr -0700 Pete apparently wrote:


 I think I will have to use the formatted height and width and be
 consistant
 about how much room is around the borders of the controls on each card.


 If your cards vary in size but are static, that is not changed dynamically
 by users, then you could save the desired width and height of each card in
 custom properties and resize each card in preopencard.

 Robert


 __**_
 use-livecode mailing list
 use-livecode@lists.runrev.com
 Please visit this url to subscribe, unsubscribe and manage your
 subscription preferences:
 http://lists.runrev.com/**mailman/listinfo/use-livecodehttp://lists.runrev.com/mailman/listinfo/use-livecode


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


formattedheight and formattedwidth

2011-06-25 Thread Pete
I have a number of cards in the same substack that need to be displayed with
different heights and widths.  In the preOpenStack handlerr, I have:

set the height of this stack to the formattedheight of this card
set the width of this stack to the formattedwidth of this card

The height and width end up several pixels short of what they need to be.
 Adding 10 to the fomattedheight and 20 to the formattedwidth makes things
about right, but

Pete
Molly's Revenge http://www.mollysrevenge.com
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: formattedheight and formattedwidth

2011-06-25 Thread J. Landman Gay

On 6/25/11 2:17 PM, Pete wrote:

I have a number of cards in the same substack that need to be displayed with
different heights and widths.  In the preOpenStack handlerr, I have:

set the height of this stack to the formattedheight of this card
set the width of this stack to the formattedwidth of this card

The height and width end up several pixels short of what they need to be.
  Adding 10 to the fomattedheight and 20 to the formattedwidth makes things
about right, but


Use the height and width, not the formattedHeight and formattedWidth. 
The formatted measurements only include the smallest area that 
encompasses all the visible objects objects. If the card objects don't 
touch all four sides, the formatted measurements will be smaller than 
the card measurements.


--
Jacqueline Landman Gay | jac...@hyperactivesw.com
HyperActive Software   | http://www.hyperactivesw.com

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode