PDA

View Full Version : Anchoring width problem



MooCow
January 8th, 2020, 01:40
I'm too tired to continue for tonight, but I seem to have run into a problem:
I have a frame, and I want a description underneath that frame, in the "below" anchoring position.
...and I can set that up like this:


<template name="charattribute_description">
<stringcontrol>
<anchored position="below" width="57" /><!-- Width is being ignored for some reason. -->
<font>sheetlabelmini</font>
<center />
<nodrag />
<readonly />
</stringcontrol>
</template>

<charattribute_description>
<anchored to="willpowerframe" />
<!-- <anchored>
<top parent="willpowerframe" anchor="bottom" />
</anchored> -->
<static textres="char_desc_attr_willpower1" />
</charattribute_description>

However, for longer texts, the text will not go beyond the edges of the above frame, and I can't seem to change that width. Instead the text will get pushed to the left, and get cut off to the right of it.

As you can see, I've tried another method too, that I've commented out, but with that method I can define no horizontal anchor, since the text needs to be centered.

...so I'm going to bed now and hope that you can solve this little puzzle in 8 hours or so.

Moon Wizard
January 8th, 2020, 01:56
The "below" position sets the top, left and right anchors; which is why your width is being ignored (i.e. left and right anchors are already set).

Regards,
JPG

celestian
January 8th, 2020, 02:00
"below" uses the same width as the object you're anchoring to. If you want to have a width different than your "below" parent you need to use something like "bottomleft" or "insidebottomleft" and adjust alignment.

Moon Wizard
January 8th, 2020, 02:03
Also, "belowleft", "belowright", ...

JPG

MooCow
January 8th, 2020, 18:34
Yes, but I want the description CENTERED underneath the frame, and an " anchor="center" " center-to-center anchor doesn't seem to exist.

For example, this doesn't work:


<template name="charattribute_description">
<stringcontrol>
Debug.console()
<anchored width="57">
<top anchor="bottom" />
<center relation="relative" anchor="center" />
</anchored>
<font>sheetlabelmini</font>
<center />
<nodrag />
<readonly />
</stringcontrol>
</template>


<charattribute_description>
<anchored to="willpowerframe">
<top parent="willpowerframe" />
<center parent="willpowerframe" />
</anchored>
<static textres="char_desc_attr_willpower1" />
</charattribute_description>



Do I really need to use scripting here in this case? ...and some post layout "width/2" offset?

Moon Wizard
January 8th, 2020, 20:11
There is no "center" anchor. There is only left/top/right/bottom anchors.

Why not try:


<template name="charattribute_description">
<stringcontrol>
<anchored position="below" />
<font>sheetlabelmini</font>
<center />
<nodrag />
<readonly />
</stringcontrol>
</template>


Regards,
JPG

MooCow
January 8th, 2020, 21:08
There is no "center" anchor. There is only left/top/right/bottom anchors.

Why not try:


<template name="charattribute_description">
<stringcontrol>
<anchored position="below" />
<font>sheetlabelmini</font>
<center />
<nodrag />
<readonly />
</stringcontrol>
</template>


Regards,
JPG

Because, as I said in my first post, the frame is too small to fit the text.
Maybe an ASCII illustration will help.
OOOO = The frame
Willpower = The text


What I want:

..OOOO...
Willpower


What I get with <anchored position="below" />:

..OOOO...
..Will...

MooCow
January 8th, 2020, 21:35
...and the console repeats this:
"Ruleset Warning: window: Anchored static width ignored for control () in windowclass (charsheet_front)
Ruleset Warning: window: Anchored static width ignored for control (attributeslabel) in windowclass (charsheet_front)"

damned
January 8th, 2020, 22:02
Because, as I said in my first post, the frame is too small to fit the text.

As Moon Wizard said in the second post the anchoring you are using also inherits the left and right boundaries/anchors.

Increase the size of the frame.

celestian
January 8th, 2020, 22:05
"below" uses the same width as the object you're anchoring to. If you want to have a width different than your "below" parent you need to use something like "bottomleft" or "insidebottomleft" and adjust alignment.


...and the console repeats this:
"Ruleset Warning: window: Anchored static width ignored for control () in windowclass (charsheet_front)
Ruleset Warning: window: Anchored static width ignored for control (attributeslabel) in windowclass (charsheet_front)"

See my comment.... and JPGs.

If you want to alter the width of the thing you're anchoring to it you need to stop using bottom.

Use bottomleft, insidebottomleft, belowleft or belowright.

MooCow
January 8th, 2020, 22:06
As Moon Wizard said in the second post the anchoring you are using also inherits the left and right boundaries/anchors.
Exactly, so he shouldn't have then recommended it. He's not paying attention.


Increase the size of the frame.
No, because it's a visible frame. It needs to be exactly that size.

I solved it, though:


<anchored>
<top anchor="bottom" />
<left anchor="center" offset="-29,0" />
<right anchor="center" offset="29,0" />
</anchored>

It's not as dynamic as I would have wanted it, but it's alright.

MooCow
January 8th, 2020, 22:13
See my comment.... and JPGs.
If you want to alter the width of the thing you're anchoring to it you need to stop using bottom.
Use bottomleft, insidebottomleft, belowleft or belowright.

Yes, I read your comment, but inline anchoring doesn't work when the frame is smaller than the contents. You need to instead anchor the second control next to the first control, like I did in my above post, but you also have to specify the horizontal anchors there, but in the exact way that I did with offsets.

Thanks for all of your attempts at helping, though.

Moon Wizard
January 8th, 2020, 23:15
In the example provided, there is no width attribute, so the warning won't appear. Also, the example I provided works fine. If you need more room, then use the offset attribute.

Here's the same example I provided with the extra offset attribute:


<template name="charattribute_description">
<stringcontrol>
<anchored position="below" offset="29,0" />
<font>sheetlabelmini</font>
<center />
<nodrag />
<readonly />
</stringcontrol>
</template>


Please consider toning down your posts. Everyone has been offering to help with the time they can (including me), but we are not the ones writing you code, nor have the time to necessarily read everything about what you are doing when answering questions. Clarifications are fine, just realize everyone is trying to help.

Regards,
JPG

MooCow
January 8th, 2020, 23:41
In the example provided, there is no width attribute, so the warning won't appear. Also, the example I provided works fine. If you need more room, then use the offset attribute.

Here's the same example I provided with the extra offset attribute:


<template name="charattribute_description">
<stringcontrol>
<anchored position="below" offset="29,0" />
<font>sheetlabelmini</font>
<center />
<nodrag />
<readonly />
</stringcontrol>
</template>


Please consider toning down your posts. Everyone has been offering to help with the time they can (including me), but we are not the ones writing you code, nor have the time to necessarily read everything about what you are doing when answering questions. Clarifications are fine, just realize everyone is trying to help.

Regards,
JPG

Your previous example was just my first example with the width removed. I tried it both with and without the (ignored) width, and got the same result as before: It cuts off the text at the left margin. That's why I'm saying that you're not paying attention. The example that you've given me now seems like it's just going to push the position further to the right, so I can tell that that won't help, at just a glance.

My tone is just fine. Saying that you're not paying attention, isn't saying that you're not trying to help. It's just that you're not paying enough attention to understand the problem. Nobody here was. I understand that it can be hard to understand just part of a code, so I'm sure that you had good intentions and tried your best, though. Don't feel attacked. Sometimes help just doesn't work out.

Moon Wizard
January 8th, 2020, 23:47
That offset tag (when used with the below position) will expand the left anchor to the left and the right anchor to the right.

For the tone, I'm just saying that the way you are phrasing things is a good way to rub people the wrong way. Telling people that they aren't paying attention when they are trying to help you is not a positive motivator. Just the fact that you are judging the most recent example and saying it's wrong without actually trying is another negative motivator.

Regards,
JPG

MooCow
January 9th, 2020, 00:42
That offset tag (when used with the below position) will expand the left anchor to the left and the right anchor to the right.
Aha! So that's how that works. I've read a lot about anchoring and offsets, over and over again, but never have I read that it works in both directions like that.


For the tone, I'm just saying that the way you are phrasing things is a good way to rub people the wrong way. Telling people that they aren't paying attention when they are trying to help you is not a positive motivator.
Well, then tell me how I could have motivated you to pay more attention in a more positive manner then? I tried it with an illustration after the no-width example, and people still kept misunderstanding and recommending very irrelevant stuff. When I can't be clearer, then what can I do on my end, for it not to be my fault?


Just the fact that you are judging the most recent example and saying it's wrong without actually trying is another negative motivator.
Well, it was an exception of the normal offset rules, and there's no hint of that anywhere. I'm sure that it'll work, now that you've explained why. I humored you on your first example, but at this point - when I've found a solution - I've deleted all the commented out alternative code, so testing another example that seemed to make no sense, seemed like a waste of time. These last weeks I've done a lot of things to humor your (you guys's) attempts at help, including downloading and scouring through uncommented code without any indication of what to look for what so ever. Somewhere it stops being my fault, and starts being your fault.

damned
January 9th, 2020, 01:10
Exactly, so he shouldn't have then recommended it. He's not paying attention.

If you want to play that game you will likely end up with less and less people to talk to.
As has been said several times in several threads people here are helping or offering to you on their own time.
You can ignore the advice if you choose. You can chalk it up to one persons view if you want.

At least in the context of this thread - you are the one not paying attention - Moon Wizard did not recommend this anchoring method. You did. And he told you why it is ignoring width.


I humored you on your first example, but at this point - when I've found a solution - I've deleted all the commented out alternative code, so testing another example that seemed to make no sense, seemed like a waste of time. These last weeks I've done a lot of things to humor your (you guys's) attempts at help, including downloading and scouring through uncommented code without any indication of what to look for what so ever. Somewhere it stops being my fault, and starts being your fault.

Doubling down is absolutely the right way to play on this. Good luck.

MooCow
January 9th, 2020, 01:40
If you want to play that game you will likely end up with less and less people to talk to.
You say that as if I should care. I don't come here to get friends. I don't even like friends. Friends are gooey things that cling to you like they're gum on a sole, and all they invite is trust and eventually betrayal. I come here to work. I need people who pay attention to my problems, and can listen if I tell them to pay attention. If they can't do that, then we're both better off if they don't reply. If you're going to help out, then the least that I ask of you, is that you ask me if something is unclear to you.
I don't do the "social" bit, so social extortion won't work on me. I've given up trying to be emotionally liked two decades ago. Don't help me because I'm a nice guy. Help me because I'm trying to give something back in the end. ...or don't. It's your loss.
The way I see it, is that as long as we don't call eachother names, we can get along on a professional level.


As has been said several times in several threads people here are helping or offering to you on their own time.
Yes, but if they're not paying attention, they're wasting their time, which is even worse.


At least in the context of this thread - you are the one not paying attention - Moon Wizard did not recommend this anchoring method. You did. And he told you why it is ignoring width.
He told me "Why aren't you trying X?". He's posted more than one post here.


Doubling down is absolutely the right way to play on this. Good luck.
I don't understand why you have to butt in and defend Moon Wizard all the time. At least I hope that we're clear that I don't care. If nobody ends up replying to me, because people don't have thick enough skin, then I'm fine with that. It's not my right to get help.

LordEntrails
January 9th, 2020, 18:00
I understand you dont want friends. I understand a little bit about how for some people social interactions can be challenging and undesirable. I grew up with a friend who was in the Asperbergers spectrum.

Let me suggest another way to look at or consider the input you have received, most of us here trying to help are not getting paid to help people. The only benefit we get from helping people are either help on other topics in the future (i.e. mutual help), or out of building a human relationship (aka friendship).

The one who might be argued is getting paid to provide support has more demands and needs on their time than they can do. I.e. they have more to do than they can do. They have to make a reasonable business decision, do I spend time on X or Y? Which one is going to help the product the most in the long term? Helping a single community developer is a high risk investment and in many cases is debatable if it's worth the time. When that developer is challenging to relate to, and has stated they may not be part of the community for long, it makes it even a higher risk use of resources/time.

So, how do you get what you want? You have to be willing to give that which those who can provide the help are wanting in return. Part of that is to appear to develop those human relationships (even though you do not like them). Part of that is to show... respect, sympathy or the appearance of empathy that those people are looking for.

I understand that you wont (perhaps cant?) Have the emotional attachment that is represented by the behavior people are suggesting you present. But their is value in engaging with those social expectations. Both for you and those you interact with.

Feel free to PM me if you would care to discuss privately.

MooCow
January 9th, 2020, 19:43
I understand you dont want friends. I understand a little bit about how for some people social interactions can be challenging and undesirable. I grew up with a friend who was in the Asperbergers spectrum.
Let me suggest another way to look at or consider the input you have received, most of us here trying to help are not getting paid to help people. The only benefit we get from helping people are either help on other topics in the future (i.e. mutual help), or out of building a human relationship (aka friendship).
The one who might be argued is getting paid to provide support has more demands and needs on their time than they can do. I.e. they have more to do than they can do. They have to make a reasonable business decision, do I spend time on X or Y? Which one is going to help the product the most in the long term? Helping a single community developer is a high risk investment and in many cases is debatable if it's worth the time. When that developer is challenging to relate to, and has stated they may not be part of the community for long, it makes it even a higher risk use of resources/time.
So, how do you get what you want? You have to be willing to give that which those who can provide the help are wanting in return. Part of that is to appear to develop those human relationships (even though you do not like them). Part of that is to show... respect, sympathy or the appearance of empathy that those people are looking for.
I understand that you wont (perhaps cant?) Have the emotional attachment that is represented by the behavior people are suggesting you present. But their is value in engaging with those social expectations. Both for you and those you interact with.
Feel free to PM me if you would care to discuss privately.

I actually think that there's value in not engaging with social expectations. Let me put it in a similee: You have a 1850s era mechanical workshop with exposed cogwheels, for some alien reason being run by 1850s women in ball gowns. Then one day Lady Moon Wizard's gown gets swept into the machinery, gets stuck, and the machinery stops. I point this out, but she says that it's fine - that her gown isn't stuck at all, and that I'm just being silly. She's a proper lady, after all - she'd never do such a clumpsy thing. In fact it's all my fault that the machinery has stopped. It must be. ...and then when I "double down", her best friend Lady Damned comes to her defense, claiming that I should respect women, or I'll never get married.

Would I go along with this social farse, we'd never get the workshop running again. I could stand around pretending that everything's just fine with Lady Moon Wizard being stuck, and nothing would be solved.

When people tell me to pay attention, I just make a better effort to pay attention. Damned told me to pay attention, and so I actually did, and I still concluded that I was right. This isn't hard, and I don't take offence at tones. I just want to get work done. While I can still get work done, you can be social all you want, but once the work stops, we have a problem.

Zacchaeus
January 9th, 2020, 21:18
Right enough of this nonsense; I'm closing this thread.