18.10.2014 Views

Object-oriented Software in Ada 95

Object-oriented Software in Ada 95

Object-oriented Software in Ada 95

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

TUI the implementation 341<br />

New_L<strong>in</strong>e<br />

Position<br />

Put<br />

Move to the next l<strong>in</strong>e <strong>in</strong> the w<strong>in</strong>dow. This may<br />

<strong>in</strong>volve a rack up of the text <strong>in</strong> the w<strong>in</strong>dow.<br />

Move to a new position for subsequent output to<br />

the w<strong>in</strong>dow.<br />

Write <strong>in</strong>formation <strong>in</strong>to a w<strong>in</strong>dow.<br />

23.6.2 W<strong>in</strong>dow system API<br />

The system API should not normally be required by an application program. This API is used <strong>in</strong>ternally by the<br />

TUI system to manage the w<strong>in</strong>dows on the screen.<br />

Method<br />

About<br />

Call_Call_Back<br />

Create<br />

De_Register<br />

F<strong>in</strong>alize<br />

Initialize<br />

Mark_Border<br />

Refresh<br />

Register<br />

Send_To<br />

Set_Call_Back<br />

Switch_Away<br />

Switch_To<br />

Responsibility<br />

Return <strong>in</strong>formation about the w<strong>in</strong>dow.<br />

Call the call-back function for this w<strong>in</strong>dow.<br />

Create a raw w<strong>in</strong>dow.<br />

De-register the w<strong>in</strong>dow with the Input_manager.<br />

Destruction of a w<strong>in</strong>dow.<br />

Controlled <strong>in</strong>itialization of a w<strong>in</strong>dow.<br />

Set border to <strong>in</strong>dicate state of w<strong>in</strong>dow active, or<br />

<strong>in</strong>active.<br />

Re-display the w<strong>in</strong>dow.<br />

Register w<strong>in</strong>dow on screen.<br />

Send a character to the w<strong>in</strong>dow for process<strong>in</strong>g.<br />

Set a call-back function for this w<strong>in</strong>dow.<br />

Make w<strong>in</strong>dow non active.<br />

Make w<strong>in</strong>dow active.<br />

23.6.3 The specification for the class W<strong>in</strong>dow<br />

The specification is as follows:<br />

with Pack_Constants, Class_Root_W<strong>in</strong>dow, Class_W<strong>in</strong>dow_Control;<br />

use Pack_Constants, Class_Root_W<strong>in</strong>dow, Class_W<strong>in</strong>dow_Control;<br />

package Class_W<strong>in</strong>dow is<br />

type W<strong>in</strong>dow is new Root_W<strong>in</strong>dow with private;<br />

type P_W<strong>in</strong>dow is access all W<strong>in</strong>dow;<br />

type Mode is ( Visible, Invisible );<br />

type P_Cbf is access function(Str:<strong>in</strong> Str<strong>in</strong>g) return Str<strong>in</strong>g;<br />

Construction of a w<strong>in</strong>dow is performed by:<br />

procedure Initialize( The:<strong>in</strong> out W<strong>in</strong>dow );<br />

procedure F<strong>in</strong>alize( The:<strong>in</strong> out W<strong>in</strong>dow );<br />

procedure Framework( The:<strong>in</strong> out W<strong>in</strong>dow;<br />

Abs_X_Crd, Abs_Y_Crd: Positive;<br />

Max_X_Crd, Max_Y_Crd: Positive;<br />

Cb:<strong>in</strong> P_Cbf := null );<br />

procedure Create ( The:<strong>in</strong> out W<strong>in</strong>dow;<br />

Abs_X_Crd, Abs_Y_Crd: Positive;<br />

Max_X_Crd, Max_Y_Crd: Positive );<br />

A call-back function is set and executed with:<br />

© M A Smith - May not be reproduced without permission

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!