Using PilRC with Plua2

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Using PilRC with Plua2

rmodesi
I am new to both Plua2 and PilRC so these questios may be answered
somewhere else. If so please point me to that source.

1. How can I include multiple bitmats into a PilRC file and reference
them in Plua2. Using the code
     pilrc Picture.rcp
produces a file named Tbmp07d0.bin (there is an error in the Plua2
documentation naming the file Tbmp03d0.bin). This file is then
incorporated into the PRC file with the command
   plua2c -name MyApp -cid MyCr -o MyApp.prc MyApp.lua Tbmp07d0.bin
In Plua this resource is accessed via
   bmp = resource.open("Tbmp", 2000)
Assuming that I can incorporate several bitmaps into the Picture.rcp
file how are they accessed in Plua?

2. PilRC appears to have the ability to create many different
resource types. I am particularly interested in forms that included
buttons, push buttons, lists etc. Can these resources be used in
Plua2? If so please explain or direct me to some sample code.

Again many thanks in advance,

Ron Modesitt

Reply | Threaded
Open this post in threaded view
|

Re: Using PilRC with Plua2

migueletto-2
Hi,

--- In [hidden email], "ron.modesitt" <rmodesi@...> wrote:

> 1. How can I include multiple bitmats into a PilRC file and
reference them in Plua2. Using the code
>      pilrc Picture.rcp
> produces a file named Tbmp07d0.bin (there is an error in the Plua2
> documentation naming the file Tbmp03d0.bin). This file is then
> incorporated into the PRC file with the command
>    plua2c -name MyApp -cid MyCr -o MyApp.prc MyApp.lua Tbmp07d0.bin
> In Plua this resource is accessed via
>    bmp = resource.open("Tbmp", 2000)
> Assuming that I can incorporate several bitmaps into the Picture.rcp
> file how are they accessed in Plua?

You just need to include multiple bitmaps in the same rcp file, each
with a different ID. Example:

BITMAPFAMILYEX ID 2000
BEGIN
  BITMAP "Picture1.bmp" BPP 8 DENSITY 144
END

BITMAPFAMILYEX ID 2001
BEGIN
  BITMAP "Picture2.bmp" BPP 8 DENSITY 144
END

Pilrc will create two .bin files, and both must be included in the
plua2c command line. You can now access both from within Plua:

bmp1 = resource.open("Tbmp", 2000)
bmp2 = resource.open("Tbmp", 2001)

> 2. PilRC appears to have the ability to create many different
> resource types. I am particularly interested in forms that included
> buttons, push buttons, lists etc. Can these resources be used in
> Plua2? If so please explain or direct me to some sample code.

No. Plua does not use UI controls stored in Form resources. UI
controls must be created dinamically with gui.control().

Regards,
Marcio.

Reply | Threaded
Open this post in threaded view
|

Re: Using PilRC with Plua2

rmodesi
Marcio,
Thank you so much for the information. I am really enjoying Plua and
hope to develop some usable structural engineering applications with
it's capabilities.

Ron
--- In [hidden email], "migueletto" <migueletto@...> wrote:
>
> Hi,
>
> --- In [hidden email], "ron.modesitt" <rmodesi@> wrote:
>
> > 1. How can I include multiple bitmats into a PilRC file and
> reference them in Plua2. Using the code
> >      pilrc Picture.rcp
> > produces a file named Tbmp07d0.bin (there is an error in the
Plua2
> > documentation naming the file Tbmp03d0.bin). This file is then
> > incorporated into the PRC file with the command
> >    plua2c -name MyApp -cid MyCr -o MyApp.prc MyApp.lua
Tbmp07d0.bin
> > In Plua this resource is accessed via
> >    bmp = resource.open("Tbmp", 2000)
> > Assuming that I can incorporate several bitmaps into the
Picture.rcp

> > file how are they accessed in Plua?
>
> You just need to include multiple bitmaps in the same rcp file, each
> with a different ID. Example:
>
> BITMAPFAMILYEX ID 2000
> BEGIN
>   BITMAP "Picture1.bmp" BPP 8 DENSITY 144
> END
>
> BITMAPFAMILYEX ID 2001
> BEGIN
>   BITMAP "Picture2.bmp" BPP 8 DENSITY 144
> END
>
> Pilrc will create two .bin files, and both must be included in the
> plua2c command line. You can now access both from within Plua:
>
> bmp1 = resource.open("Tbmp", 2000)
> bmp2 = resource.open("Tbmp", 2001)
>
> > 2. PilRC appears to have the ability to create many different
> > resource types. I am particularly interested in forms that
included
> > buttons, push buttons, lists etc. Can these resources be used in
> > Plua2? If so please explain or direct me to some sample code.
>
> No. Plua does not use UI controls stored in Form resources. UI
> controls must be created dinamically with gui.control().
>
> Regards,
> Marcio.
>