Page 1 of 1

[Issue] Manager for multiple drawing layers

Posted: Wed Mar 15, 2023 3:26 pm
by peter.matter
Currently each layer can be managed induvidually. As I am using more than 100 layers, I currently cannot swich on/off all or a portion of layers. Now I have click to each one-by-one, whicht takes a lot of time.
A manger allowing this is a matrix would be great. Even better would be if those "views-settings" could be stored and loaded.
This would increase efficiency a lot.
What do you think, can this be done?
Thank you and kind regards - Peter

Re: Draw: Missing layer manager handling for all layers at once

Posted: Wed Mar 15, 2023 10:39 pm
by Lupp
I'm afraid you will have to resort to programming ...

Code: Select all

REM  *****  BASIC  *****
REM This is a raw sketch to proove the concept.
REM No storing, loading or details and ...

Sub layerSettingsToSpreadsheet()
drawD = ThisComponent REM assumed Draw doc
lyMgr = drawD.LayerManager
lyNs  = lyMgr.ElementNames
uLy   = Ubound(lyNs)
Dim lyInf(-1 To uLy)
lyInf(-1) = Array("Name", "IsLocked", "IsVisible", "IsPrintable", "Title", "Description")
For j = 0 To uLy
 j_ly = lyMgr(j)
 With j_ly
  REM .DataArray only accepts String or Double.
  lyInf(j) = Array(.Name, _
                   Abs(CDbl(.IsLocked)), _
                   Abs(CDbl(.IsVisible)), _
                   Abs(CDbl(.IsPrintable)), _
                   .Title, _
                   .Description)
 End With
Next j
shD = StarDesktop.loadComponentFromURL("private:factory/scalc", "_blank", 0, Array())
sheet = shD.Sheets(0)
rg = sheet.getCellRangeByPosition(0, 0, 5, uLy+1)
rg.setDataArray(lyInf)
End Sub

Sub layerSettingsFromSpreadsheet(pSheet)
      REM similar / revesrse
End Sub

Re: Missing layer manager handling for all layers at once

Posted: Mon Mar 20, 2023 1:14 pm
by peter.matter
One problem that takes much extra time to modify the status of the layers is the fact, that the tabs of the layers move back to position one, after each interaction (e.g. shift + left-click for switching on/off visibilty).

This is annoying when there are many layer-tabs.

--> A fast imporovent would be IF THE LAYER-TABS WOULD NOT ALINGN BACK to pos one after interactons. Better: They just stay where the are. Movement of the tab-line can be done with the arrows, as it works so far.

--> Is this a change that can be done soon?

Re: Missing layer manager handling for all layers at once

Posted: Mon Mar 20, 2023 3:39 pm
by MrProgrammer
peter.matter wrote: Wed Mar 15, 2023 3:26 pm A [manager] allowing this [as] a matrix would be great. Even better would be if those "views-settings" could be stored and loaded.
peter.matter wrote: Mon Mar 20, 2023 1:14 pm A fast [improvement] would be if the layer-tabs would not [align] back to pos one after [interactions]. Is this a change that can be done soon?
As explained in the Survival guide, this is a user-to-user assistance forum, not the bug fix or feature enhancement site. We are not the developers. I'm a user just like you are. The developers will not see your posts here. Hint: you need to enable spell check on your browser.
Reporting bugs or suggestions

Sometimes we can offer workarounds to difficulties. Thus far Lupp has suggested that you investigate Draw's Application Programming Interface and create some macros for yourself. You will find the macro learning-curve to be quite steep, but these resources will help you get started. Later you can package your macros as an extension so that others can benefit from your achievement. Actually you may want to start by reviewing existing extensions to see if any of them would be helpful for your project. I have no personal experience with any of the Draw extensions.
Andrew Pitonyak's OpenOffice Macro Information
MRI - UNO Object Inspection Tool
Creating a simple extension

Your "manager" idea seems to be similar to these issues:
Add layer toolbar / window or include in navigator
Add functionality to the navigator in Draw
Unlock/Lock ALL/NONE layers in Draw
Can not manipulate layer property of object