Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

Always try to do things in chronological order; it's less confusing that way.


computers / comp.sys.apple2 / toolbox alert with resources

SubjectAuthor
* toolbox alert with resourcesTom Thumb
`* Re: toolbox alert with resourcesKelvin Sherlock
 `* Re: toolbox alert with resourcesTom Thumb
  `- Re: toolbox alert with resourcesKelvin Sherlock

1
toolbox alert with resources

<71734773-aa61-4dc2-9d6d-9bc733f957f7n@googlegroups.com>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=4936&group=comp.sys.apple2#4936

  copy link   Newsgroups: comp.sys.apple2
X-Received: by 2002:ac8:1483:0:b0:39c:bf89:65f0 with SMTP id l3-20020ac81483000000b0039cbf8965f0mr36970519qtj.35.1669400855571;
Fri, 25 Nov 2022 10:27:35 -0800 (PST)
X-Received: by 2002:ac8:5892:0:b0:3a5:3d08:9fdd with SMTP id
t18-20020ac85892000000b003a53d089fddmr37049076qta.684.1669400855400; Fri, 25
Nov 2022 10:27:35 -0800 (PST)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.sys.apple2
Date: Fri, 25 Nov 2022 10:27:35 -0800 (PST)
Injection-Info: google-groups.googlegroups.com; posting-host=24.185.98.244; posting-account=PB2qngoAAACRVoANRzBDZM-TqC_DJF8g
NNTP-Posting-Host: 24.185.98.244
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <71734773-aa61-4dc2-9d6d-9bc733f957f7n@googlegroups.com>
Subject: toolbox alert with resources
From: justlike...@gmail.com (Tom Thumb)
Injection-Date: Fri, 25 Nov 2022 18:27:35 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 2223
 by: Tom Thumb - Fri, 25 Nov 2022 18:27 UTC

"Toolbox Programming in C", Mike Westerfield, pg79 states:

"size This field is generally a single character controlling the size of the alert window.
The character is a numeric digit, from 0 to 9. All but the first of these digits corresponds to a specific size window, but the 0 character is the first byte of a nine byte field. The other bytes define the size of the window by listing the edges as two-byte integers, in this format:..."

I get rects and V1,H1,V2,H2 coordinates But not how to specify them in a string.

My question: If I enter a 0 as the first character of the alert string how do I then enter the four two-byte integers in the nine byte field? I've tried several things and I'm thinking it's simple but I'm not getting it. I know there are calls I can make providing templates but I'm trying to get this resource example working specifying a custom alert size.

/*- About Box --------------------------------------------------*/

resource rAlertString (1) {
"43/"
"Frame 1.0\n"
"by Mike Westerfield\n"
"\n"
"Contains libraries from ORCA C,\n"
"Copyright 1991, Byte Works Inc."
"/^#0\$00";
};

Re: toolbox alert with resources

<tls6ls$1956c$1@dont-email.me>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=4938&group=comp.sys.apple2#4938

  copy link   Newsgroups: comp.sys.apple2
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: ema...@domain.com (Kelvin Sherlock)
Newsgroups: comp.sys.apple2
Subject: Re: toolbox alert with resources
Date: Sat, 26 Nov 2022 00:02:52 -0500
Organization: A noiseless patient Spider
Lines: 43
Message-ID: <tls6ls$1956c$1@dont-email.me>
References: <71734773-aa61-4dc2-9d6d-9bc733f957f7n@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Info: reader01.eternal-september.org; posting-host="d254d9e37173df95460380d537811788";
logging-data="1348812"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18RuXsLcj763i+IKqBupYidlsZ6x3ji8wc="
User-Agent: Unison/2.2
Cancel-Lock: sha1:/aQG2XPQZG8Hn7fukMuwkyfj+NA=
 by: Kelvin Sherlock - Sat, 26 Nov 2022 05:02 UTC

The rectangle needs to be broken up into 8 bytes (keeping in mind the
words are little endian). Assuming a rectangle of (20, 20, 180, 620),
convert it to hexadecimal (0x0014, 0x0014, 0x00b4, 0x026c), convert it
to bytes (0x14, 0x00, 0x14, 0x00, 0xb4, 0x00, 0x6c, 0x02), and embed it
("0\0x14\0x00\0x14\0x00\0xb4\0x00\0x6c\0x02" ... )

On 2022-11-25 18:27:35 +0000, Tom Thumb said:

>
> "Toolbox Programming in C", Mike Westerfield, pg79 states:
>
> "size This field is generally a single character controlling the size
> of the alert window.
> The character is a numeric digit, from 0 to 9. All but the first of
> these digits corresponds to a specific size window, but the 0 character
> is the first byte of a nine byte field. The other bytes define the size
> of the window by listing the edges as two-byte integers, in this
> format:..."
>
> I get rects and V1,H1,V2,H2 coordinates But not how to specify them in
> a string.
>
> My question: If I enter a 0 as the first character of the alert string
> how do I then enter the four two-byte integers in the nine byte field?
> I've tried several things and I'm thinking it's simple but I'm not
> getting it. I know there are calls I can make providing templates but
> I'm trying to get this resource example working specifying a custom
> alert size.
>
>
> /*- About Box --------------------------------------------------*/
>
> resource rAlertString (1) {
> "43/"
> "Frame 1.0\n"
> "by Mike Westerfield\n"
> "\n"
> "Contains libraries from ORCA C,\n"
> "Copyright 1991, Byte Works Inc."
> "/^#0\$00";
> };

Re: toolbox alert with resources

<04942912-4142-4b3a-a501-2f1544fe1945n@googlegroups.com>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=4943&group=comp.sys.apple2#4943

  copy link   Newsgroups: comp.sys.apple2
X-Received: by 2002:ac8:4698:0:b0:39c:1435:423e with SMTP id g24-20020ac84698000000b0039c1435423emr25662851qto.490.1669522226593;
Sat, 26 Nov 2022 20:10:26 -0800 (PST)
X-Received: by 2002:ac8:782:0:b0:397:9da8:fd12 with SMTP id
l2-20020ac80782000000b003979da8fd12mr42467523qth.523.1669522226426; Sat, 26
Nov 2022 20:10:26 -0800 (PST)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.sys.apple2
Date: Sat, 26 Nov 2022 20:10:26 -0800 (PST)
In-Reply-To: <tls6ls$1956c$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=24.185.98.244; posting-account=PB2qngoAAACRVoANRzBDZM-TqC_DJF8g
NNTP-Posting-Host: 24.185.98.244
References: <71734773-aa61-4dc2-9d6d-9bc733f957f7n@googlegroups.com> <tls6ls$1956c$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <04942912-4142-4b3a-a501-2f1544fe1945n@googlegroups.com>
Subject: Re: toolbox alert with resources
From: justlike...@gmail.com (Tom Thumb)
Injection-Date: Sun, 27 Nov 2022 04:10:26 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 3105
 by: Tom Thumb - Sun, 27 Nov 2022 04:10 UTC

Thank you much.
I belatedly found what should have been enough to clue me in in chapter 10 of the ORCA/C manual but I still would have had trouble with it without your help.

On Saturday, November 26, 2022 at 12:02:55 AM UTC-5, Kelvin Sherlock wrote:
> The rectangle needs to be broken up into 8 bytes (keeping in mind the
> words are little endian). Assuming a rectangle of (20, 20, 180, 620),
> convert it to hexadecimal (0x0014, 0x0014, 0x00b4, 0x026c), convert it
> to bytes (0x14, 0x00, 0x14, 0x00, 0xb4, 0x00, 0x6c, 0x02), and embed it
> ("0\0x14\0x00\0x14\0x00\0xb4\0x00\0x6c\0x02" ... )
> On 2022-11-25 18:27:35 +0000, Tom Thumb said:
>
> >
> > "Toolbox Programming in C", Mike Westerfield, pg79 states:
> >
> > "size This field is generally a single character controlling the size
> > of the alert window.
> > The character is a numeric digit, from 0 to 9. All but the first of
> > these digits corresponds to a specific size window, but the 0 character
> > is the first byte of a nine byte field. The other bytes define the size
> > of the window by listing the edges as two-byte integers, in this
> > format:..."
> >
> > I get rects and V1,H1,V2,H2 coordinates But not how to specify them in
> > a string.
> >
> > My question: If I enter a 0 as the first character of the alert string
> > how do I then enter the four two-byte integers in the nine byte field?
> > I've tried several things and I'm thinking it's simple but I'm not
> > getting it. I know there are calls I can make providing templates but
> > I'm trying to get this resource example working specifying a custom
> > alert size.
> >
> >
> > /*- About Box --------------------------------------------------*/
> >
> > resource rAlertString (1) {
> > "43/"
> > "Frame 1.0\n"
> > "by Mike Westerfield\n"
> > "\n"
> > "Contains libraries from ORCA C,\n"
> > "Copyright 1991, Byte Works Inc."
> > "/^#0\$00";
> > };

Re: toolbox alert with resources

<tm09oo$1nft4$1@dont-email.me>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=4945&group=comp.sys.apple2#4945

  copy link   Newsgroups: comp.sys.apple2
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: kel...@pro-kegs.uucp (Kelvin Sherlock)
Newsgroups: comp.sys.apple2
Subject: Re: toolbox alert with resources
Date: Sun, 27 Nov 22 18:10:43 EST
Organization: ProLine [pro-kegs] -- Nome, AK
Lines: 61
Distribution: world
Message-ID: <tm09oo$1nft4$1@dont-email.me>
References: <04942912-4142-4b3a-a501-2f1544fe1945n@googlegroups.com>
Injection-Date: Sun, 27 Nov 2022 18:20:08 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="38890bd5b0c0535d3961a102c076b2d9";
logging-data="1818532"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+l6ZOhkO3uFWwgsb7mPPjMEWe7iARGesQ="
Cancel-Lock: sha1:Kfgzupu/kCoxJeTTtiBPh7Wy/0c=
 by: Kelvin Sherlock - Sun, 27 Nov 2022 23:10 UTC

Another option would be to replace the rAlertString rez definition:

(don't update types.rez, just put this in your rez file before using it.
There will be a warning about the redefinition but compile rez=(-rd) will
disable it).

type rAlertString {

switch {
case sizeCustom:
key byte = 0x30;
rect;
case size30: key byte = 0x31;
case size60: key byte = 0x32;
case size110: key byte = 0x33;
case size175: key byte = 0x34;
case size110: key byte = 0x35;
case siz140: key byte = 0x36;
case size200: key byte = 0x37;
case size250: key byte = 0x38;
case size300: key byte = 0x39;
};

switch {
case iconNone: key byte = 0x30;
case iconCustom:
key byte = 0x31;
longint;
int;
int;
case iconStop: key byte = 0x32;
case iconNote: key byte = 0x33;
case iconCaution: key byte = 0x34;
case iconDisk: key byte = 0x35;
case iconDiskSwap: key byte = 0x36;
};

string;
string = $"00";
};

Example usage:

resource rAlertString (3) {

sizeCustom { { 12, 34, 56, 78 }},
iconNone {} ,
"/abc/#0"
};

resource rAlertString (4) {
size30 {},
iconCustom { 12, 20, 40 } ,
"/abc/#0"
};

Note the empty {} are required even if it's a standard size or icon. The
trailing $00 terminator is automatically provided.

-------
ProLine: kelvin@pro-kegs

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor