Recent Changes - Search:

WikiDoc

Categories

The [winPane] command

This file documents the [winPane] command introduced in version 8.2a3d5 of AlphaX.


Introduction

The [winPane] command lets you create and manipulate subpanes in AlphaX's document windows. Since version 8.2a3d5 of AlphaX, the possibility of splitting a document window has been reimplemented and enhanced. Older versions only allowed to split a window into two subpanes stacked vertically. It is now possible to split a window vertically or horizontally in as many subpanes as desired. The process of splitting is controlled at two levels:

  • in the graphical interface, there is a new Splitting popup menu located under the Marks popup menu and above the vertical scrollbar. It

replaces the splitting bar found there in older versions of Alpha.

  • programmatically, there is a new command called [winPane] which lets you create, select or close subpanes.

There is always only one currently active pane. Clicking on any pane makes it current: this pane is designated by a blue focus bounding box. This focus rectangle is drawn only if the window is split. In order to make the graphical interface less cumbersome, there is not a pair of scrollbars for each pane: when a window is split, the scrollbars of the document window act on the currently selected pane. If the specified index is out of range, the command does nothing.

Synopsis

The formal syntax of the [winPane] command is:

winPane ?-w win? subcommand ?options?

The possible subcommands are described below. Depending on the subcommand, some options can be additionnally specified. The -w option is used to specify the window the command applies to: by default, this is the topmost document window. Each window maintains a list of its panes in creation order: each time a subpane is added by subdivision of the current pane, it is appended to the list. Some commands accept an index argument which is the index of the pane in the list. This index is 0-based. The original pane is always at index 0.

The [close] subcommand

This command lets you close the pane corresponding to the specified index. The syntax is:

 
     winPane ?-w win? close ?index?

If no index is specified, the command applies to the currently selected pane. if the pane which is closed was the current one, then the first pane (at index 0) becomes current.

The [count] subcommand

This command returns the number of subpanes of a document window. This provides a way of testing if a window is split: if it is not, the count is equal to 1. The syntax is:

 
     winPane ?-w win? count

Note: testing if a window is split can still be done as in the older versions of Alpha using the command [getWinInfo]. The split key of the returned array is equal to 1 if the window is split, 0 otherwise.

The [current] subcommand

This command can take two forms:

 
     winPane ?-w win? current
     winPane ?-w win? current index

In the first case, it returns the index of the currently selected pane. In the second case, the pane at the specified index becomes current. Note: this is the same value returned by the [getWinInfo] command in the paneNum key.

The [next] subcommand

This command lets you select the next pane. This is circular: if the current pane is the last one then the command selects the first one in the list. The syntax is:

 
     winPane ?-w win? next

This command returns the index of the newly selected pane.

The [previous] subcommand

This command lets you select the previous pane. This is circular: if the current pane is the first one then the command selects the last one. The syntax is:

 
     winPane ?-w win? previous

This command returns the index of the newly selected pane.

The [refresh] subcommand

This command performs an immediate redraw of the pane corresponding to the specified index. The syntax is:

 
     winPane ?-w win? refresh ?index?

where index designates the index of the pane you want to be redrawn. The first pane is at index 0. If the specified index is out of range, the command does nothing. If no index is specified, the command applies to the currently selected pane.

The [split] subcommand

This command lets you split the currently selected pane into two subpanes. Subdivision can be performed horizontally (subpanes side-by-side) or vertically (subpanes stacked). The syntax is:

 
     winPane ?-w win? split ?(horizontally|vertically)?

If the last argument is not specified, the pane is split vertically by default.

Hook

The menu displayed when the user clicks on the Splitting popup is built via the splitMenuHook hook. The [splitMenuHook] proc is defined in AlphaTcl and returns the token associated with this menu.

Examples

Here are a few basic examples which can be executed from the Tcl shell in AlphaX:

 
     Welcome to AlphaX's AlphaTcl shell.
      set win $PREFS/prefs.tcl
      edit $win
      winPane -w $win split
      winPane -w $win current 1
      winPane -w $win split horizontally
      winPane -w $win count
     3
      winPane -w $win next
     2
      winPane -w $win next
     0
      winPane -w $win close
      winPane -w $win count
     2


(add your comments here...) bd test

Page last modified on October 02, 2008, at 01:59 PM
Hosted on SourceForge.net Logo