home *** CD-ROM | disk | FTP | other *** search
- /*
- #### # # # #
- # # # # # The FreeWare C library for
- # # ## ### # # # # ### RISC OS machines
- # # # # # # # # # # # ___________________________________
- # # #### ### ## # # # #
- # # # # # # # # # # Please refer to the accompanying
- #### ### #### # # ##### # ### documentation for conditions of use
- ________________________________________________________________________
-
- File: Pane.h
- Author: Copyright © 1994 Ainsley Pereira. Complete revision by Keith Hall
- Version: 1.11 (30th March 1994)
- Purpose: Handles windows with panes.
- */
-
- /*
- * Implementation notes
- * --------------------
- * The offset of the pane from the master window is taken from their initial
- * positions, so make sure that they are in the right places relative to each
- * other when you save them from Glazier (or FormEd if you have a pet
- * triceratops ;-)
- * Another point is that the relative positions are kept constant from the top
- * left of the visible area. This only matters if the master window is
- * resizeable. The top left was chosen as most panes are either in fixed size
- * windows (eg. Options windows) or are down the top left of a window (eg.
- * Artworks, Draw etc.)
- * If you want to do something like StrongEd's status bar then you'll have to
- * a) Alter pane_data.offset.y everytime you resize the window, or
- * b) Alter the code to use xxxxx.min.y - yyyyy.min.y (although then you can't
- * have the Artworks/Draw style panes).
- */
-
- #ifndef __dl_pane_h
- #define __dl_pane_h
-
- #ifndef __dl_wimp_h
- #include "Wimp.h"
- #endif
-
- #ifndef __dl_window_h
- #include "Window.h"
- #endif
-
- #ifndef __dl_wimpswis_h
- #include "WimpSWIs.h"
- #endif
-
- typedef struct
- {
- window_handle master;
- window_handle pane;
- wimp_point offset;
- wimp_point size;
- union
- {
- int value;
- struct
- {
- unsigned int isopen :1; /* master/pane pair currently displaying */
- unsigned int fixed :1; /* pane sticks to position relative to top of master */
- unsigned int resize :1; /* pane shrinks with relation to size of master */
- unsigned int horiz :1; /* pane is horizontal (shrinks to left when resize flag set
- and window gets resized (like !StrongEd toolbar) */
- unsigned int vert :1; /* pane is horizontal (shrinks to top when resize flag set
- and window moves (like !Draw) */
- unsigned int dummy :27;
- } data;
- } flags;
- } pane_data;
-
- #define pane_OPEN 0x0001
- #define pane_FIXED 0x0002
- #define pane_RESIZE 0x0004
- #define pane_HORIZ 0x0004
- #define pane_VERT 0x0004
-
-
- /* Pane_OpenEvent
- * Install as a handler for event_OPEN on the master window.
- * It opens the pane at the correct offset at the correct size.
- */
-
- extern BOOL Pane_OpenEventHandler(event_pollblock *event, void *reference);
-
-
- /*
- * Pane_GetSysHandle
- * Returns a pointer to the pane_data structure associated with the 'master' window.
- * Returns NULL if the master window isn't linked.
- */
-
- extern pane_data *Pane_GetSysHandle(window_handle master);
-
-
- /* Pane_SetFlags
- * Sets the flags of the Pane/Master window relationship.
- * Returns the current flags if 'flags' is -1.
- * Returns NULL if the master window isn't linked.
- */
-
- extern int Pane_SetFlags(window_handle master, int flags);
-
-
- /*
- * Pane_Link
- * Links the pane window handle to the master window handle.
- * if offset or size == NULL then the data is taken from the template
- */
-
- extern void Pane_Link(window_handle mast, window_handle pane,
- wimp_point *offset, wimp_point *size, int flags);
-
-
- /*
- * Pane_CreateAndLink
- * Creates the windows using Window_Create and then Pane_Links them together.
- * returns window handle of the master window
- * if offset or size == NULL then the data is taken from the template
- */
-
- extern window_handle Pane_CreateAndLink(char *mastname, char *panename,
- int mastmaxsize, int panemaxsize,
- wimp_point *offset, wimp_point *size, int flags);
-
- /*
- * Pane_Show
- * Simply calls Window_Show for the master window and the pane.
- */
-
- extern void Pane_Show(window_handle window, window_openpos openpos);
-
-
- /*
- * Pane_Delete
- * Calls Window_Delete for the master window and the pane and de-links them
- */
-
- extern void Pane_Delete(window_handle window);
-
-
- /*
- * Pane_Hide
- * Simply calls Window_Hide for the master window and the pane.
- */
-
- extern void Pane_Hide(window_handle window);
-
- #endif
-