[Solved] Stack flow chart boxes; put current box on top

Discuss the drawing application
Post Reply
Graham Phillips
Posts: 1
Joined: Mon Nov 18, 2019 10:20 am

[Solved] Stack flow chart boxes; put current box on top

Post by Graham Phillips »

I'm creating a flow chart in draw and I want to be able to quickly and easily expand on the description of the various options.
To keep the chart itself a manageable size, I want to just have a simple "Option 1a" text box, then when you click on the link it brings up a full description of what Option 1a is.
I've got that far, but if I then need another bigger text box for every option, I haven't gained anything, so I want to stack the boxes.
You can see in this example that text box 1b is on top of 1a. I have clicked on Option 1a, so text box 1a is highlighted, but it is still partly hidden behind 1b.
Is it possible to stack multiple boxes like this and have the currently selected one automatically on top, without having to manually 'Arrange > Bring to Front' each time?

Image
Last edited by MrProgrammer on Sat Jun 03, 2023 4:51 pm, edited 1 time in total.
Reason: Tagged ✓ [Solved] -- MrProgrammer, forum moderator
Open Office 4.1.3 on Windows 11 Home
User avatar
Zizi64
Volunteer
Posts: 11364
Joined: Wed May 26, 2010 7:55 am
Location: Budapest, Hungary

Re: Stacking flow chart boxes. Current box on top?

Post by Zizi64 »

The two yellow shapes are Form Control elements in my sample file. You can assign macros to their Events. The Events (clicking on the shape) will call the macro. You can move/modify/edit them in the Edit mode of the Form control elements.

The macros can get the Defeult String property of the Caller Object. Based on the string, the macro can get the desired description shape and it can change the ZOrder property of the description shape object to the maximal value of the Draw Page.
To set Max value of the Zorder seems to be same as the BringToFront feature of the shapes.

The sample file was created in my LibreOffice 6.4.7. and it tested in my LibreOffice 6.4.7. and the AOO 4.1.3 portable version
BringToFront.odg
(19.38 KiB) Downloaded 215 times
And here is the macro code what is embedded in the sample file too:

Code: Select all

REM  *****  BASIC  *****

Sub BringToFront(oEvent as object)
	
	'xray oEvent
	sShapenameToFront = oEvent.Source.Model.String
	oDrawDoc = ThisComponent
	oDrawPage = oDrawDoc.GetCurrentController.GetCurrentPage
	iShapeNr = oDrawPage.getCount()
	For j = 0 To iShapeNr-1 
		oShape = oDrawPage.getByIndex(j)
			If oShape.GetName() = sShapenameToFront then
				'xray oShape
				oShape.ZOrder = iShapeNr-1
			end if
	Next j
End Sub
Tibor Kovacs, Hungary; LO7.5.8 /Win7-10 x64Prof.
PortableApps/winPenPack: LO3.3.0-7.6.2;AOO4.1.14
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
Post Reply