Visio how do I restore layout defaults? - visio

I have built an org chart in Visio. I have been fooling with the automatic layout and then tried dragging things to where I want them. I guess the dragging creates overrides of the automated layout, and I cannot find a way to delete the overrides to get back to defaults. Is there any evidence that Visio has not become a total piece of crap?
Here is what the Re-Layout button does now 1

Related

Visio protect object from selection

A big problem for me creating diagrams in visio (and powerpoint and similar programs) is that if you have a background object, it blocks you from selecting multiple objects by lassoing. Instead you end up moving the background around, this is annoying.
In many applications there's an option to "lock" or "protect" a specific object so it becomes un-selectable while still visible on the drawing. In Visio there is no simple way of doing this as far as I'm aware.
There's a rather convoluted way of doing this, it feels to me like Visio designers wanted to make this difficult on purpose. The methods I'm aware of I list here, feel free to let me know of a better way(s)
You can protect objects from selection by going to (hidden by default) Developer tab and pick "shape design"-> protection -> selection. However this does not actually protect them from selection, which makes sense . To actually protect the said object from selection, you have to open drawing explorer, which is also hidden by default and the visibility tickbox is in hidden by default Developer tab under show/hide section.
Drawing explorer, however won't highlight whatever object you have selected in the drawing, another unexplicable design decision. If you want to see the name of the object you've selected with live update, you have to enable the diagram navigation pane. That's found in View tab on Show section under "task panes" icon. This pane does highlight whatever you've selected and you can rename the object to give it a meaningful name, but not change the shape in any other way.
To finally protect that shape from selection, right click on the top level document on the drawing explorer and pick "Protect document" and tick "shapes" and hey presto, now your background rectangle is visible but not selectable. Very straightforward indeed
There are also layers which offer similar functionality but they naturally come with their own gotchas.
You can see layers on the Drawing explorer under foreground pages, page name, "Layers" tree. To move an object on a specific layer, you cannot do it by right clicking on the object, because of course you can't. There's an assign to layer button in Home->Editing->Layers->"Assign to Layer", which will let you select the layer(s) for the selected object. You can also do this by right clicking on an object from the Drawing explorer, but you have to know the object name, because there's no reverse selection .. The object name you can get from the Diagram navigation. By default "protected" and "lock" layers do nothing.
To change what the layers do, you again go to the Home -> Editing -> Layers and select "Layer properties". This is also available from Drawing explorer by right clicking on the "layers" tree under a specific page. Here you can control if the layer is visible and/or protected. However, if you lock a layer, you also cannot move objects to/from it, as that'd be too easy. So you have to untick "lock" if you want to move stuff in and out of a protection layer.
So there are two awkward ways of doing that that I'm aware of.
If the shape really is a background object then maybe you should be looking at putting the shape on a background page. You can then make it the background page for your active page. That'll fix all your shape selection problems.

How to implement backpack UI in Unity

I want to make a backpack UI that can dynamically add and delete items like a menu, but every item in it is a picture (not a text)
I found many tutorials but all of them are panels with slots that need I to set their positions previously. I wonder if there is a better way to make it more easily.
I think the best way is to use a Vertical Layout Group:
https://docs.unity3d.com/Packages/com.unity.ugui#1.0/manual/script-VerticalLayoutGroup.html
Obviously for adding and deleting in player, you have to create buttons with relative scripts.

How to bring label over edit control

I'm trying to set up a TEdit that will be used for research, so, it would be great to have a label displaying "current" / "count" over it, as observed by pressing CTRL + F in Google Chrome:
It seems that the TLabel control's always placed behind the TEdit control.
I also tried label1.BringToFront (Both at designtime and runtime), but it had no effect. Is there a way to place a label over an edit control?
TLabel inherits from TGraphicControl which cannot be shown on top of windowed controls, no matter how many times you try to use BringToFront it's just not going to happen.
However, you can use a container control such as a TPanel that can be used to contain your TEdit and TLabel controls, see this image as an example:
That is a quick and dirty way, it's simply a TPanel containing a TEdit and TLabel as child controls
The preferred way however is to create your own control which would give you full flexibility. Often trying to piece together multiple VCL controls to appear and function how you want is not usually ideal, and so by doing it the custom way gives you more freedom and possibilities.

Visio 2007 - Org Chart generated through wizard - resizing the text

I'm using the orgwiz command line tool to auto generate an organisation chart to update every night.
It's all working as expected, apart from the fact that the text for some shapes overflows.
Does anyone know if there is a way to autoresize the text automatically somehow, whether that be from the command line or injecting a scripting call to iterate through the pages and resizing the text automagically? It all has to be done unattended.
Appreciate any help,
Tony
Modify the spahe masters so they resize based on the text.
http://msdn.microsoft.com/en-us/library/office/aa200988(v=office.10).aspx#377

How to use customized tool bar in tiny mce?

I'm using tiny mce in one of my projects and client do not want to use the Horizontal tool bar of tiny mce. He wants a centralized custom tool bar from where user can control all the properties like text color, type of text, size, back grounds and every thing that is needed to do while designing a web page using templates. I configured the mce instance with out its default tool bar and controlled the properties from the customized tool bar. And the properties are applied to the tiny mce instance as a whole. But now, the requirement has come up that, the text editing should be in MS office style.That means, if user has placed cursor at one place and changes color, nothing will be affected, but if he starts typing from the cursor position the text should have the color which was set recently. I tried to use the external tool bar option. But, my work area and customized tool bar are at different z index levels. So, positioning the tool bar fails. If I append the tool bar to my customized tool bar, it is not click-able. So, how to invoke tiny mce's core functionality using customized tool bar?
Or, Kindly suggest, should I change editor ? Then, which one should I go for ?
EDIT
As per the suggestion, I'm writing the function save the property styles and insert the span at caret position. But I'm facing some problems and could not do it after spending whole day. I could add span at caret position by using following code.
marker = ed.selection.getBookmark();
ed.selection.moveToBookmark(marker);
tinyMCE.execCommand('mceInsertContent',false,'<span id="mytitle"></span>');
But still, I failed to type inside the new span. Also, I could not figure out how to set styles to this span.
If your aim is to have your tinymce behave like MS Office you should write an own plugin which will take care of this.
I suggest if a user has placed the cursor at one place and changes color you save this color as a setting to your tinymce instance like: ed.color = 'choosencolor';
When the user start typing now you can insert a span on the first keystroke and set the color as css class or style property to this span.