Change View based on document Version 1.1beta

23 views
Skip to first unread message

Simply Notes Simply Notes

unread,
Oct 8, 2019, 3:16:07 PM10/8/19
to Notecase Pro
The attached file can be used as a local plugin for now and implements the following functionality

The script "Save View" stores the current treeview columns, layout and line number setting either as default view or as document view based on user input. The default view is stored in sn_tools.ini. If the view is to be stored in the document the values are stored in document custom properties.

The script "Load View" either loads the default view from the ini file or the document view settings from the custom properties of the document. If the user selects to load the view setup from document and the document doesn't have view details the user will be prompted with a MsgBox

Using the configuration script one can register a none interactive load view script to the event after_document_change to automatically change the view setup whenever one changes the document.

This is a beta version because the following will be implemented before the final version
  • If a user switches to a document with no view information the default view setup will be loaded
  • documentation needs to be added
  • some more error checks to be implemented
as always I welcome feedback

best
Raimund
sn_tools_V11.ncdb

Paul Merrell

unread,
Oct 9, 2019, 5:01:44 PM10/9/19
to Notecase Pro
On Tue, Oct 8, 2019 at 12:16 PM 'Simply Notes Simply Notes' via
Notecase Pro <noteca...@googlegroups.com> wrote:
>
> The attached file can be used as a local plugin for now and implements the following functionality
>
> The script "Save View" stores the current treeview columns, layout and line number setting either as default view or as document view based on user input. The default view is stored in sn_tools.ini. If the view is to be stored in the document the values are stored in document custom properties.
>
> The script "Load View" either loads the default view from the ini file or the document view settings from the custom properties of the document. If the user selects to load the view setup from document and the document doesn't have view details the user will be prompted with a MsgBox
>
> Using the configuration script one can register a none interactive load view script to the event after_document_change to automatically change the view setup whenever one changes the document.

Just starting to look at the code. (I've been busy, sorry.)

On the .ini file handling, did you use the inilazy library that
Daniel's Plugin Developer Tools plugin provides? See that plugin's
Help file at Tips and Tricks > Configuration / INI file handling: How
to use Nc_inilazy_hmc library

If not, it might give you some ideas.

Best regards,

Paul

--
[Notice not included in the above original message: The U.S. National
Security Agency neither confirms nor denies that it intercepted this
message.]
¯\_(ツ)_/¯

Simply Notes Simply Notes

unread,
Oct 9, 2019, 5:39:12 PM10/9/19
to Notecase Pro
Hi Paul,

yes I looked at Daniel's ini handling routines but frankly was to lazy to learn them so I wrote my own - which was faster for me

I can't upload the latest version as I am on the road and I also need to validate whether there is a bug in my code or in the API for a certain use case so give me some more time before I release an official version.

btw. NCP to me is the perfect solution now - thanks to everyone involved

best regards

Raimund

Daniel H (hermocom)

unread,
Oct 10, 2019, 1:06:19 AM10/10/19
to Notecase Pro
and I still didn’t get a chance to do a more in-depth plugin review :( I’m so sorry. Will be very busy until and over the weekend as well, so hopefully next week…

Daniel

Paul Merrell

unread,
Oct 10, 2019, 1:48:49 AM10/10/19
to Notecase Pro
On Wed, Oct 9, 2019 at 2:39 PM 'Simply Notes Simply Notes' via
Notecase Pro <noteca...@googlegroups.com> wrote:
>

> btw. NCP to me is the perfect solution now - thanks to everyone involved

It scratches most of my itches. :-)

Simply Notes Simply Notes

unread,
Oct 11, 2019, 2:09:06 AM10/11/19
to Notecase Pro
Just published the release version 1.1 for review. For whatever reason I can't upload a file right now - will do when I have another network.
The currently implemented routines allows one to store the view setup specific to a document or as a default view.

The routine "Save View" asks the user whether the current view setup shoudl be stored as default or specific to the current document

The "Load View" script asks the user whether he wants to load the default view or the document specific one.

Finally the script "Remove View" allows the user to remove the custom property fields used by this plugin from the current document or to reset the ini file to the default values which basically is a set width for the Title column

The Configuration script registeres or removes a routine to automatically load the view setup whenever the user switches a document. If a document specific view setup is found in the current document, this one will be loaded. Otherwise the default view setup wil be loaded. If no default view setup has been stored before by the user the initial default is just the Titel column with a width of 200.

best
Raimund

Paul Merrell

unread,
Oct 11, 2019, 3:30:10 AM10/11/19
to Notecase Pro
On Thu, Oct 10, 2019 at 11:09 PM 'Simply Notes Simply Notes' via Notecase Pro <noteca...@googlegroups.com> wrote:
The Configuration script registeres or removes a routine to automatically load the view setup whenever the user switches a document. If a document specific view setup is found in the current document, this one will be loaded. Otherwise the default view setup wil be loaded. If no default view setup has been stored before by the user the initial default is just the Titel column with a width of 200.

You might consider adding an option in configuration to set a different width for the Title column. 200 pixels renders differently depending on screen resolution and NC Pro supports everything from big screen monitors to hand-held mobile devices.

But this might not be a big problem if your Save View script stores the column width. The user would only have to drag the title column to the desired width and save the view to repeat it the next time the document opens.

Best regards,

Paul

Simply Notes Simply Notes

unread,
Oct 11, 2019, 6:46:44 AM10/11/19
to Notecase Pro
Finally was able to upload the file

best
Raimund
sn_tools_V11.ncdb
Reply all
Reply to author
Forward
0 new messages