Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.sys.acorn.programmer > #231

Re: How to put a caret in a window

From Paul Sprangers <Paul@sprie.nl>
Subject Re: How to put a caret in a window
Newsgroups comp.sys.acorn.programmer
Date 2011-04-30 12:54 +0200
Message-ID <51cc00fe22Paul@sprie.nl> (permalink)
References (6 earlier) <31d0a1ca51.Matthew@sinenomine.freeserve.co.uk> <51caa8d5c0Paul@sprie.nl> <7fbce5ca51.Matthew@sinenomine.freeserve.co.uk> <51cb982b94Paul@sprie.nl> <4dbb363e$0$30746$ba4acef3@reader.news.orange.fr>
Organization None

Show all headers | View raw


Dear Rick,

Thank you for your extensive explanation. It's certainly not your fault (or
anyone else's) that I still don't understand a bit of it.

> Just a thought - do you have StrongHelp (or for browsing under Windows, 
> my StrawHelp) ? If so, grab the OS320 help file.

I do have the StrongHelp OS manual, and I even have the PRM's in PDF
format. Unfortunately, both tools seem to assume a certain threshold of
intelligence.

With the help of many people I've found out how to put the caret at the end
of string, while typing. Therefore, I had to pas large values in [R3] and
[R4] on entry in SYS "Font_ScanString". Only then, [R3] would contain a
value other than 0 on exit.

Now I want to use the same call to find the x value of the nearest
character to put the caret next to, when I click somewhere in the middle of
the string.

Let me describe how I wander in the dark:

> · How wide is a string?
> Use large values for R3, R4 and no split character
> · Given a width, how much of a string will fit?
> AND · Address of a mouse click?
> Use correct width in R3, large value in R4 and (if needed) a split char 
> in the buffer at R5
> · Graphical position of a caret?
> Set R7 to offset into string, use huge values for R3,4, and no split

The first problem that I encounter, when I read the OS stronghelp file (or
your extract), is that I can't decide whether I need to find the 'Address
of a mouse click?' or the 'Graphical position of a caret?'

When I go for the Address of a mouse click, then I have to 'Use correct
width in R3...' First of all, I have no idea what is meant by 'correct
width'. Is it the width of the entire string, or the width of the string
until the position of the caret? Or is it something completely different?
And what is 'correct'? What are the dimensions? Pixels, points,
millipoints, number of characters?
Anyhow, when I enter a value in [R3] other than &7FFFFFFF, the call will
always return 0 in [R3] on exit.

When I go for the Graphical position of a caret, I have to set R7 to offset
into string. It may have something to do with the fact that I'm Dutch, but
what on earth is 'offset into string'? And again, what are its dimensions?

Those help files would be so much more helpful (at least to me), if they
provided an example, e.g.:

***********************************************************************
EXAMPLE:
Say, the x value of the mouse click is 1970.
The start of the string is at 1660.
So, the relative x value [offset?] of the pointer is 310.
When you want to put the caret next to the nearest character at that
position, you will have to use the following parameters:

SYS "Font_ScanString",font%,string$,(1<<7)+(1<<8)+(1<<17),304*400,&3FFFFFF
TO ,charnumb%,,cx%

[R3] (=cx%) will now contain the exact position of the caret. [It doesn't.]
[R1] will contain the number or the character that is nearest. [Idem.]

***********************************************************************

Something like that, but then with the right parameters, of course.
(Probably, this example example will prove that I totally misunderstand the
whole concept, rather than missing a few details.)

Apologise for my lack of notion. Hopefully, it won't discourage you to help
me once more.

Kind regards,
Paul Sprangers

Back to comp.sys.acorn.programmer | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

How to put a caret in a window Paul Sprangers <Paul@sprie.nl> - 2011-04-25 17:34 +0200
  Re: How to put a caret in a window Matthew Phillips <mnews@sinenomine.freeserve.co.uk> - 2011-04-25 19:29 +0100
    Re: How to put a caret in a window Paul Sprangers <Paul@sprie.nl> - 2011-04-25 23:28 +0200
      Re: How to put a caret in a window Matthew Phillips <mnews@sinenomine.freeserve.co.uk> - 2011-04-26 23:17 +0100
        Re: How to put a caret in a window Matthew Phillips <mnews@sinenomine.freeserve.co.uk> - 2011-04-27 07:38 +0100
          Re: How to put a caret in a window Paul Sprangers <Paul@sprie.nl> - 2011-04-27 13:31 +0200
            Re: How to put a caret in a window Jeremy Nicoll - news posts <jn.nntp.scrap007@wingsandbeaks.org.uk> - 2011-04-27 13:14 +0100
              Re: How to put a caret in a window Paul Sprangers <Paul@sprie.nl> - 2011-04-27 17:15 +0200
            Re: How to put a caret in a window pdm <pd.miller2@tiscali.co.uk> - 2011-04-27 08:59 -0700
              Re: How to put a caret in a window Paul Sprangers <Paul@sprie.nl> - 2011-04-27 21:50 +0200
              Re: How to put a caret in a window pdm <pd.miller2@tiscali.co.uk> - 2011-04-27 23:19 -0700
            Re: How to put a caret in a window Matthew Phillips <mnews@sinenomine.freeserve.co.uk> - 2011-04-27 19:58 +0100
              Re: How to put a caret in a window Paul Sprangers <Paul@sprie.nl> - 2011-04-27 22:15 +0200
                Re: How to put a caret in a window Martin Wuerthner <spamtrap@mw-software.com> - 2011-04-30 17:12 +0200
                Re: How to put a caret in a window Rick Murray <heyrickmail-usenet@yahoo.co.uk> - 2011-04-30 19:12 +0200
                Re: How to put a caret in a window Paul Sprangers <Paul@sprie.nl> - 2011-05-02 09:37 +0200
                Re: How to put a caret in a window Alan Wrigley <spamhater@keepyourfilthyspamtoyourself.co.uk> - 2011-05-02 08:49 +0100
                Re: How to put a caret in a window Paul Sprangers <Paul@sprie.nl> - 2011-05-02 09:59 +0200
                Re: How to put a caret in a window Alan Adams <alan@adamshome.org.uk> - 2011-05-02 21:27 +0100
                Re: How to put a caret in a window Steve Fryatt <news@stevefryatt.org.uk> - 2011-05-02 09:08 +0100
                Re: How to put a caret in a window Paul Sprangers <Paul@sprie.nl> - 2011-04-30 12:54 +0200
                Re: How to put a caret in a window Rick Murray <heyrickmail-usenet@yahoo.co.uk> - 2011-04-30 13:52 +0200
                Re: How to put a caret in a window cferris@freeRemoveuk.com.invalid - 2011-04-30 13:34 +0100
                Re: How to put a caret in a window Rick Murray <heyrickmail-usenet@yahoo.co.uk> - 2011-04-30 15:39 +0200
                Re: How to put a caret in a window Matthew Phillips <mnews@sinenomine.freeserve.co.uk> - 2011-04-28 08:20 +0100
                Re: How to put a caret in a window pdm <pd.miller2@tiscali.co.uk> - 2011-04-28 02:16 -0700
                Re: How to put a caret in a window Paul Sprangers <Paul@sprie.nl> - 2011-04-29 17:49 +0200
                Re: How to put a caret in a window Rick Murray <heyrickmail-usenet@yahoo.co.uk> - 2011-04-30 00:05 +0200

csiph-web