PDA

View Full Version : Modifying WindowClass



swbuza
July 14th, 2019, 06:21
I'm guessing there is no way to programmatically change parameters of a windowclass.

Can anyone confirm?

celestian
July 14th, 2019, 06:41
You can add/remove/adjust controls within the windowclass... alter shape/size/anchors/etc.

This might be helpful.

https://www.fantasygrounds.com/refdoc/windowinstance.xcp
https://www.fantasygrounds.com/refdoc/windowcontrol.xcp

What are you wanting to do?

swbuza
July 14th, 2019, 06:46
I'm attempting to combine two extensions into one. Both extensions add buttons to the chat window (vs. the sidebar anchor). One extension uses buttons that are 100 pixels wide and the other uses icons that are 25 pixels wide. In order to make it work, I'd need to be able to make changes to the windowclass offsets for the chat window and the sidebar subwindow within the chat window, based on the user selecting a display option under Options. I've got the option working, I can change out the icons based on the selection, but I can't figure out how to change the offsets in the windowclass.

celestian
July 14th, 2019, 06:49
I'm attempting to combine two extensions into one. Both extensions add buttons to the chat window (vs. the sidebar anchor). One extension uses buttons that are 100 pixels wide and the other uses icons that are 25 pixels wide. In order to make it work, I'd need to be able to make changes to the windowclass offsets for the chat window and the sidebar subwindow within the chat window, based on the user selecting a display option under Options. I've got the option working, I can change out the icons based on the selection, but I can't figure out how to change the offsets in the windowclass.

setAnchor() is might be what you're looking for.

If it's pre-runtime you can replace those bits with merge/replace in XML more than likely.

swbuza
July 14th, 2019, 07:18
Thanks for the tip. Might be what I want.

Also setAnchoredWidth seems like it might help.