From 8b16b739b645a3ddb31c76acd8f09de39114ea5c Mon Sep 17 00:00:00 2001 From: Steve Fryatt Date: Tue, 28 Dec 2021 12:51:47 +0000 Subject: [PATCH] Fix text for clarity. --- Chapters/ch03-a-top-toolbar.xml | 2 +- Chapters/ch04-column-headings.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Chapters/ch03-a-top-toolbar.xml b/Chapters/ch03-a-top-toolbar.xml index e419225..1a76fe6 100644 --- a/Chapters/ch03-a-top-toolbar.xml +++ b/Chapters/ch03-a-top-toolbar.xml @@ -309,7 +309,7 @@ ENDIF

Now that we have the work area coordinate for the right-hand edge of the visible toolbar, we can use Wimp_ResizeIcon to set the right-hand coordinate of the icon to be 4 OS Units in to the left from this. The Wimp won't refresh the display for us, however, so we also need to call Wimp_ForceRedraw for the whole area of the icon and the space between it and the edge of the toolbar.

-

Since this is a writeable icon, there’s one final gotcha that we must be aware of. If the caret was in the icon, the Wimp won’t move it to reflect any alteration to the position of the text. Instead we use Wimp_GetCaretPosition to find out where the caret is currently located and, if it is in our icon, call Wimp_SetCaretPosition to replace it in exactly the same place within the text.

+

Since this is a writeable icon, there’s one final gotcha that we must be aware of. If the caret was in the icon, the Wimp won’t move it to reflect any alteration to the position of the text. Instead we must use Wimp_GetCaretPosition to find out where the caret is currently located and, if it is in our icon, call Wimp_SetCaretPosition to replace it in exactly the same place within the text.

If the size of the main window is reduced now, the writeable icon will also reduce in size as seen in so that it always fills the available toolbar.

diff --git a/Chapters/ch04-column-headings.xml b/Chapters/ch04-column-headings.xml index e6d112c..36abccb 100644 --- a/Chapters/ch04-column-headings.xml +++ b/Chapters/ch04-column-headings.xml @@ -66,7 +66,7 @@

The toolbar window itself has also been updated, removing the pair of action buttons and the writeable field. In their place are four ‘heading’ icons, which should line up with the columns of coloured squares in the main window. The buttons are now passive – neither visibly pressing nor generating Mouse_Click events – although as before this is merely cosmetic.

-

For the code itself, we have gone back to and stripped out all of the code relating to the toolbox pane. First, we no longer need to load or the window, reducing the template code in PROCinitialise to loading the remaining three windows as seen in .

+

For the code itself, we have gone back to and stripped out all of the code relating to the toolbox pane. First, we no longer need to load or create the window, reducing the template code in PROCinitialise to processing the remaining three windows as seen in .

REM Load the window templates