Module project_manager
SciTE-st's project manager. [Dummy file] This module does not exist within SciTE-st's Lua state. It is here for documentation purposes only.
Usage
Requirements:
- Linux
- SciTE-st (http://caladbolg.net/scite_st.php)
- Zenity (http://freshmeat.net/projects/zenity)
Unfortunately, this project manager is GTK-specific and I know
of no way to either compile SciTE to use GTK on Windows or
port the GTK code to Windows' GUI architecture.
Creating a new browser:
TODO
See implementations of browsers 'require'd by pm.lua.
Adding a new browser:
After creating a new browser Lua file and placing it in
pm.lua's package.path, 'require' it in pm.lua.
Customizing look and feel:
There are no functions calls to make that customize the look
and feel of the project manager. Instead you can manipulate it
via GTK rc files. The project manager entry and view have
widget names of 'scite-pm-entry' and 'scite-pm-view'
respectively. I will not go into details on RC file syntax,
but I'll give you an example of my RC file:
pixmap_path "/usr/share/icons/Tango/:/home/mitchell/.icons/prog/"
style "scite-pm-display-style" {
fg[NORMAL] = "#AAAAAA" # treeview arrows foreground
fg[PRELIGHT] = "#AAAAAA" # treeview arrows hover foreground
bg[NORMAL] = "#333333" # entry border background
base[NORMAL] = "#333333" # entry, treeview background
base[ACTIVE] = "#444444" # treeview unfocused selection background
base[SELECTED] = "#444444" # entry, treeview selection background
text[NORMAL] = "#AAAAAA" # entry, treeview text foreground
text[ACTIVE] = "#AAAAAA" # treeview unfocused selection text
text[SELECTED] = "#DDDDDD" # entry, treeview selection text foreground
stock["gtk-directory"] = {{ "16x16/places/stock_folder.png", LTR }}
stock["gtk-folder-new"] = {{ "16x16/actions/folder_new.png", LTR }}
stock["prog-class"] = {{ "class.png", LTR }}
stock["prog-enum"] = {{ "enum.png", LTR }}
stock["prog-field"] = {{ "field.png", LTR }}
stock["prog-interface"] = {{ "interface.png", LTR }}
stock["prog-literal"] = {{ "literal.png", LTR }}
stock["prog-method"] = {{ "method.png", LTR }}
stock["prog-namespace"] = {{ "namespace.png", LTR }}
stock["prog-reference"] = {{ "reference.png", LTR }}
stock["prog-struct"] = {{ "struct.png", LTR }}
}
binding "scite-pm-key-style" {
bind "m" { "popup-menu" () }
}
widget "*scite-pm-entry" style "scite-pm-display-style"
widget "*scite-pm-view" style "scite-pm-display-style"
widget "*scite-pm-view" binding "scite-pm-key-style"
Functions
| GetContentsForTreeView (entry_text, expanding) | Processes input parameter to create and return a list of items to display in the SciTE tree view. |
| GetContextMenu (selected_item) | Processes input parameter to create a context menu for the selected item. |
| PerformAction (selected_item) | Given input, performs an action. |
| PerformMenuAction (menu_item, selected_item) | Given input, performs an action. |
| file_chooser (title, multiple, save, directory) | Prompts a user to select a file or files. |
| show_error (text) | Displays an error message. |
| text_input (text, pipe, editable, width, height) | Prompts a user for input or displays text in a text view. |
| user_input (title, text, entry_text, width) | Prompts a user for input. |
Functions
- GetContentsForTreeView (entry_text, expanding)
-
Processes input parameter to create and return a list of items to display in the SciTE tree view. Called by C++ when tree view contents are requested for display.
Parameters
- entry_text: The text to process.
- expanding: Optional flag indicating if the contents of a parent are being requested. Defaults to false.
Return value:
table of items to display (single level). The return table consists of ids with an associated table of values. The values recognized are 'parent', 'pixbuf', and 'display_text'. 'parent' is a boolean specifying whether or not the item is a parent that can contain children (e.g. a folder that can contain files). 'pixbuf' is a string GTK stock-id indicating an icon to display. 'display_text' is the Pango marked up text displayed in the tree view. Note that you only need to return a SINGLE level of data. When parents are expanded, this function will be called again to return another level inside the parent expanded. At this point, 'entry_text' behaves like the 'select_item' parameter in 'PerformAction'. See also: PerformAction - GetContextMenu (selected_item)
-
Processes input parameter to create a context menu for the selected item. Called by C++ when a tree view item is right-clicked.
Parameters
- selected_item: The currently selected item in the tree view. It is structured as described in 'PerformAction'.
Return value:
table of menu items. The return table consists of an ordered list of strings to be used to construct a context menu. The strings are handled the following way: If the string starts with 'gtk-', a stock menu item is created. If the string is 'separator', a menu separator item is created. Otherwise a regular menu item with a mnemonic is created. See also: PerformAction - PerformAction (selected_item)
-
Given input, performs an action. Called by C++ when a non-parent item has been activated. Available actions: Open(filename), GotoLine(linenum).
Parameters
- selected_item: The currently selected item in the tree view. It consists of all parents of selected_item and the contents of the entry field, separated by '/'s, concatenated into one string. If the tree view is a file browser for example, input will be the path to the selected file (e.g. /tmp/foo/bar.txt).
- PerformMenuAction (menu_item, selected_item)
-
Given input, performs an action. Called by C++ when a context menu selection has been made.
Parameters
- menu_item: The label of the menu item selected.
- selected_item: The currently selected item in the tree view. It is structured as described in 'PerformAction'.
- file_chooser (title, multiple, save, directory)
-
Prompts a user to select a file or files.
Parameters
- title: The dialog title.
- multiple: Optional flag indicating multiple selection.
- save: Optional flag activating save mode.
- directory: Optional directory to list initially.
Return value:
string file selected or table of selected files. - show_error (text)
-
Displays an error message.
Parameters
- text: The error text to display.
- text_input (text, pipe, editable, width, height)
-
Prompts a user for input or displays text in a text view.
Parameters
- text: Optional default text to display.
- pipe: Optional flag indicating that text is a command whose output is piped as stdin to zenity.
- editable: Optional flag indicating if text view is editable (true by default).
- width: Optional width of the dialog.
- height: Optional height of the dialog.
Return value:
string text view text. - user_input (title, text, entry_text, width)
-
Prompts a user for input.
Parameters
- title: The dialog title.
- text: The label text for the text entry.
- entry_text: Optional default entry text.
- width: Optional width of the dialog. (Default is 300.)
Return value:
string user input.