Skip to content

Commit

Permalink
Fix text for clarity.
Browse files Browse the repository at this point in the history
  • Loading branch information
steve-fryatt committed Dec 28, 2021
1 parent 3a2eeeb commit 8b16b73
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Chapters/ch03-a-top-toolbar.xml
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ ENDIF</code>

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

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

<p>If the size of the main window is reduced now, the writeable icon will also reduce in size as seen in <reference id="fig-top-bar-icon-resize"/> so that it always fills the available toolbar.</p>

Expand Down
2 changes: 1 addition & 1 deletion Chapters/ch04-column-headings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@

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

<p>For the code itself, we have gone back to <reference id="dl-top-bar-2"/> 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 <function>PROCinitialise</function> to loading the remaining three windows as seen in <reference id="list-col-head-load"/>.</p>
<p>For the code itself, we have gone back to <reference id="dl-top-bar-2"/> 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 <function>PROCinitialise</function> to processing the remaining three windows as seen in <reference id="list-col-head-load"/>.</p>

<code id="list-col-head-load" lang="bbcbasic" title="Loading the three window templates">REM Load the window templates

Expand Down

0 comments on commit 8b16b73

Please sign in to comment.