Activity Events Window
#1
Posted 30 January 2016 - 10:24 AM
#2
Posted 03 February 2016 - 02:28 AM
Is this a possibility, perhaps as a switchable option, and easy to implement?
Thanks
#3
Posted 03 February 2016 - 03:06 AM
steamer_ctn, on 03 February 2016 - 02:28 AM, said:
Is this a possibility, perhaps as a switchable option, and easy to implement?
It's probably possible to make it resize itself to fit the text, as long as there is a limit, but don't bother with an options - just do it. :)
(When the UI is redone in https://blueprints.l...pec/gui-refresh it will definitely be fixed.)
#4
Posted 03 February 2016 - 12:41 PM
Thanks for the reply.
When is the UI programmed to be done? As at the moment, I don't know how to set up the window resizing, and I would need to try and work out the code?
Thanks
#5
Posted 04 February 2016 - 11:29 AM
steamer_ctn, on 03 February 2016 - 12:41 PM, said:
The new UI work is stalled at the moment, so I wouldn't worry about it.
As for the resizing, you just need to call "SizeTo(int width, int height)" once you've figured out the right size. I suggest that you do this at the end of the "ActivityWindow.Layout" function, but taking care not to get in to a loop - calling "SizeTo" will trigger "Layout" again, but only if the new size is different. The calculation will involve the "scrollbox" and "Message" variables in some way, maybe just as simply as figuring out which is taller and by how much. You can get the current size from "Location".
#6
Posted 04 February 2016 - 08:36 PM
Thanks for the feedback.
James Ross, on 04 February 2016 - 11:29 AM, said:
Ok, I will not hold my breath waiting on it.
I have now had time to play with the code in the ActivityWindow.cs file, and found the following.
James Ross, on 04 February 2016 - 11:29 AM, said:
Firstly, I had a play with the SizeTo statement with fixed values, and you are correct that it does resize the window.
For comparison, I have attached some screenshots. The original window is attached as "orig.jpg". I think that its size is "fixed" at 383 x 158 (according to the "Location" information).
I set the SizeTo statement to 766 x 316, and got the box shown in "sizeto.jpg". Which didn't appear to preserve the same proportions as the original by leaving a big gap at the bottom of the window.
Upon investigation, it appears that the pop up window is made up of a number of boxes, including the outer darker box, and the text box.
I then added scaling factors to code lines 42 & 51 as below.
: base(owner, Window.DecorationSize.X + owner.TextFontDefault.Height * 2 * 25, Window.DecorationSize.Y + owner.TextFontDefault.Height * 2* 8 + ControlLayout.SeparatorSize * 2, Viewer.Catalog.GetString("Activity Events"))
var hbox = vbox.AddLayoutHorizontal(Owner.TextFontDefault.Height * 2 * 6);
The result is shown in "scaled.jpg". This appears to be a more pleasing effect for boxes with larger volumes of text.
As each activity window will have different amounts of text in them, trying to scale the box off the text amount (I am still not certain how to do this) will probably result in various size pop boxes appearing throughout the activity, which may not be a pleasant effect, depending upon the parts of the screen that they cover.
My personal preference would be:
i) to use a scaling factor
ii) set it in the activity (act) file so that an activity builder can control how big or small the boxes are displayed.
As I am still uncertain about how to size the boxes off the text, if you feel that it can and should be done on that basis, can you provide some additional clues about how to do it?
Thanks
#7
Posted 05 February 2016 - 10:12 AM
steamer_ctn, on 04 February 2016 - 08:36 PM, said:
Looks like the code lays it out at a fixed height instead of flexing it. This should be reasonably easy to fix by changing the following code:
var hbox = vbox.AddLayoutHorizontal(Owner.TextFontDefault.Height * 6);
To something like:
var hbox = vbox.AddLayoutHorizontal(vbox.RemainingHeight - (ControlLayout.SeparatorSize + vbox.TextHeight) * 2);
I also recommend that the resizing only happens in the vertical dimension, otherwise it will indeed look very odd throughout an activity.
Do NOT let this be set in the activity file; any kind of information like this is very sensitive to changes in the interface (both visual and structural) and would likely become obsolete or need replacement with another, different value.
#8
Posted 05 February 2016 - 10:56 PM
Thanks for the feedback.
James Ross, on 05 February 2016 - 10:12 AM, said:
var hbox = vbox.AddLayoutHorizontal(vbox.RemainingHeight - (ControlLayout.SeparatorSize + vbox.TextHeight) * 2);
I am sorry, but I still need some clarification.
Is it simply a case of replacing the appropriate line with the above code, or are there some other calculations that need to also be done?
I have inserted the above line, and the box appears to be the same size as the default one.
Thanks
#9
Posted 06 February 2016 - 01:36 PM
steamer_ctn, on 05 February 2016 - 10:56 PM, said:
I have inserted the above line, and the box appears to be the same size as the default one.
Yes, replace the existing line with mine. My line wasn't tested so might need some tweaking, that's all.
If the window is kept the same size as it is now, my change won't make any difference - however, if you make the window bigger with a "SizeTo" then it should make things lay out much better than they currently do.
#10
Posted 07 February 2016 - 01:00 PM
James Ross, on 06 February 2016 - 01:36 PM, said:
If the window is kept the same size as it is now, my change won't make any difference - however, if you make the window bigger with a "SizeTo" then it should make things lay out much better than they currently do.
Thanks for the further feedback.
The window now appears to resize correctly.
The final piece of the puzzle is how to trigger a resize of the popup window?
Can you see where the amount of text to be displayed in the window can be measured, and then compared to trigger the SizeTo statement if it is over a certain amount?
Thanks