Drawing on dialogues

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

Drawing on dialogues

Terrence Chun
Is there a way to draw on dialog boxes?

   gui.dialog(0,32,312,281,title)
   screen.line(160,0,160,30)
   gui.event

creates the dialog box and title, but no line drawn. when I destroy
this dialog, there is no line in the main screen either.

Also, is it possible to use print() within a dialog box as well?

- Terry


Reply | Threaded
Open this post in threaded view
|

Re: Drawing on dialogues

Berkant Atay
Hi,

I am afraid I don't know a way to draw graphics on a
dialogue box in plua. However, it is possible to
change the appearance of some of the standard gui
elements, such as buttons, using bitmap resources
(gui.button(text,g,bmpId), and you can have more
control on most of the gui elements using the
gui.control function. Please refer to Plua2 doc.
Regards,
Berkant.

--- Terrence Chun <[hidden email]> wrote:

> Is there a way to draw on dialog boxes?
>
>    gui.dialog(0,32,312,281,title)
>    screen.line(160,0,160,30)
>    gui.event
>
> creates the dialog box and title, but no line drawn.
> when I destroy
> this dialog, there is no line in the main screen
> either.
>
> Also, is it possible to use print() within a dialog
> box as well?
>
> - Terry
>
>
>

Reply | Threaded
Open this post in threaded view
|

Re: Drawing on dialogues

Terrence Chun
It was more for a cosmetic result. Under Plua1.1, I was able to
create a dialog and draw a line on the screen on top of the dialog.
This doesn't appear to be possible under Plua2.0

-- Terry

--- In &#65007;[hidden email]&#65007;, Berkant Atay <&#65007;berkant_atay@...&#65007;> wrote:

>
> I am afraid I don't know a way to draw graphics on a
> dialogue box in plua. However, it is possible to
> change the appearance of some of the standard gui
> elements, such as buttons, using bitmap resources
> (gui.button(text,g,bmpId), and you can have more
> control on most of the gui elements using the
> gui.control function. Please refer to Plua2 doc.
> Regards,
> Berkant.
>
> --- Terrence Chun <&#65007;docterry@...&#65007;> wrote:
>
> > Is there a way to draw on dialog boxes?
> >
> >    gui.dialog(0,32,312,281,title)
> >    screen.line(160,0,160,30)
> >    gui.event
> >
> > creates the dialog box and title, but no line drawn.
> > when I destroy
> > this dialog, there is no line in the main screen
> > either.


Reply | Threaded
Open this post in threaded view
|

Re: Re: Drawing on dialogues

bh77a-3
It is possible with Plua 2, at least in version 2.0b4.  I have yet to
update my Illusion source to 2.0b7, but will try a couple of tests to
see if I can get this working.

- Brian

On Sun, 2007-03-25 at 20:54 +0000, Terrence Chun wrote:

> It was more for a cosmetic result. Under Plua1.1, I was able to
> create a dialog and draw a line on the screen on top of the dialog.
> This doesn't appear to be possible under Plua2.0
>
> -- Terry
>
> --- In &#65007;[hidden email]&#65007;, Berkant Atay
> <&#65007;berkant_atay@...&#65007;> wrote:
> >
> > I am afraid I don't know a way to draw graphics on a
> > dialogue box in plua. However, it is possible to
> > change the appearance of some of the standard gui
> > elements, such as buttons, using bitmap resources
> > (gui.button(text,g,bmpId), and you can have more
> > control on most of the gui elements using the
> > gui.control function. Please refer to Plua2 doc.
> > Regards,
> > Berkant.
> >
> > --- Terrence Chun <&#65007;docterry@...&#65007;> wrote:
> >
> > > Is there a way to draw on dialog boxes?
> > >
> > > gui.dialog(0,32,312,281,title)
> > > screen.line(160,0,160,30)
> > > gui.event
> > >
> > > creates the dialog box and title, but no line drawn.
> > > when I destroy
> > > this dialog, there is no line in the main screen
> > > either.
>
>
>
>
>  

Reply | Threaded
Open this post in threaded view
|

Re: Re: Drawing on dialogues

bh77a-3
In reply to this post by Terrence Chun
Can someone confirm that the graphics commands don't seem to work at all.  They work for me in the main form testing area, but that is it.

I will experiment with this some more... this is very bad as if this doesn't work, I can't update Illusion to b7.


---- Brian Houghton <[hidden email]> wrote:

> It is possible with Plua 2, at least in version 2.0b4.  I have yet to
> update my Illusion source to 2.0b7, but will try a couple of tests to
> see if I can get this working.
>
> - Brian
>
> On Sun, 2007-03-25 at 20:54 +0000, Terrence Chun wrote:
> > It was more for a cosmetic result. Under Plua1.1, I was able to
> > create a dialog and draw a line on the screen on top of the dialog.
> > This doesn't appear to be possible under Plua2.0
> >
> > -- Terry
> >
> > --- In &#65007;[hidden email]&#65007;, Berkant Atay
> > <&#65007;berkant_atay@...&#65007;> wrote:
> > >
> > > I am afraid I don't know a way to draw graphics on a
> > > dialogue box in plua. However, it is possible to
> > > change the appearance of some of the standard gui
> > > elements, such as buttons, using bitmap resources
> > > (gui.button(text,g,bmpId), and you can have more
> > > control on most of the gui elements using the
> > > gui.control function. Please refer to Plua2 doc.
> > > Regards,
> > > Berkant.
> > >
> > > --- Terrence Chun <&#65007;docterry@...&#65007;> wrote:
> > >
> > > > Is there a way to draw on dialog boxes?
> > > >
> > > > gui.dialog(0,32,312,281,title)
> > > > screen.line(160,0,160,30)
> > > > gui.event
> > > >
> > > > creates the dialog box and title, but no line drawn.
> > > > when I destroy
> > > > this dialog, there is no line in the main screen
> > > > either.
> >
> >
> >
> >
> >  
>

Reply | Threaded
Open this post in threaded view
|

Re: Re: Drawing on dialogues

Emil Tchekov-2
That's why I am still using Plua 1. Plua 2 is still Beta...



Am Montag, 26. März 2007 18:46 schrieb [hidden email]:

> Can someone confirm that the graphics commands don't seem to work at all.
> They work for me in the main form testing area, but that is it.
>
> I will experiment with this some more... this is very bad as if this
> doesn't work, I can't update Illusion to b7.
>
> ---- Brian Houghton <[hidden email]> wrote:
> > It is possible with Plua 2, at least in version 2.0b4.  I have yet to
> > update my Illusion source to 2.0b7, but will try a couple of tests to
> > see if I can get this working.
> >
> > - Brian
> >
> > On Sun, 2007-03-25 at 20:54 +0000, Terrence Chun wrote:
> > > It was more for a cosmetic result. Under Plua1.1, I was able to
> > > create a dialog and draw a line on the screen on top of the dialog.
> > > This doesn't appear to be possible under Plua2.0
> > >
> > > -- Terry
> > >
> > > --- In &#65007;[hidden email]&#65007;, Berkant Atay
> > >
> > > <&#65007;berkant_atay@...&#65007;> wrote:
> > > > I am afraid I don't know a way to draw graphics on a
> > > > dialogue box in plua. However, it is possible to
> > > > change the appearance of some of the standard gui
> > > > elements, such as buttons, using bitmap resources
> > > > (gui.button(text,g,bmpId), and you can have more
> > > > control on most of the gui elements using the
> > > > gui.control function. Please refer to Plua2 doc.
> > > > Regards,
> > > > Berkant.
> > > >
> > > > --- Terrence Chun <&#65007;docterry@...&#65007;> wrote:
> > > > > Is there a way to draw on dialog boxes?
> > > > >
> > > > > gui.dialog(0,32,312,281,title)
> > > > > screen.line(160,0,160,30)
> > > > > gui.event
> > > > >
> > > > > creates the dialog box and title, but no line drawn.
> > > > > when I destroy
> > > > > this dialog, there is no line in the main screen
> > > > > either.
>
> Yahoo! Groups Links
>
>
>
Reply | Threaded
Open this post in threaded view
|

RE: Re: Drawing on dialogues

Blake Winton-3
In reply to this post by Terrence Chun
What do you (Am) mean by "the main form testing area"?

I've got some code that seems to work fine at
http://bwinton.latte.ca/bzr/Plua/src/
(Specifically, "Plua Sorting.lua" calls various Plua 2  drawing funcs.
 i.e. gui.menu, screen.moveto, screen.line...)

(Oh, wait that's what you meant by "main form testing area"?)

My only other thought is that you probably want to shift your
screen.line into the gui.event handler, along the lines of:

-- Main Loop
while 1 do
  ev,id=gui.event()
  if ev==frmDrawForm then
    -- put your drawing code here...
  elseif ev==ctlSelect then
    -- put your button handling code here...

Actually, nevermind that.  It totally didn't work.  But oddly, the
following code did something when I tapped:

gui.dialog(0,32,312,281,"title")
while 1 do
  ev,id = gui.event()
  screen.line(60,0,60,80)
  if ev==appStop then
    break
  end
end

(I'm sure I'm doing something bad there by not destroying my  dialog,
but let's ignore that for now.)

And, in fact, the following code worked just fine:
gui.dialog(0,32,312,281,"title")
ev,id = gui.event(0)
screen.line(60,0,60,80)
-- The next line is there to pause before exitting ev,id = gui.event()

So there you go.  You apparently need to pump the frmDrawForm event
(which you can't see) before you start to draw your stuff.

Later,
Blake.

> -----Original Message-----
> From: [hidden email] [mailto:[hidden email]] On Behalf Of
> Emil Tchekov
> Sent: Tuesday, March 27, 2007 3:47 PM
> To: [hidden email]
> Subject: Re: [plua] Re: Drawing on dialogues
>
> That's why I am still using Plua 1. Plua 2 is still Beta...
>
> Am Montag, 26. März 2007 18:46 schrieb [hidden email]:
> > Can someone confirm that the graphics commands don't seem to work at
> > all.  They work for me in the main form testing area, but that is
> > it.
> >
> > I will experiment with this some more... this is very bad as if this
> > doesn't work, I can't update Illusion to b7.
> >
> > > > > > gui.dialog(0,32,312,281,title)
> > > > > > screen.line(160,0,160,30)
> > > > > > gui.event


Reply | Threaded
Open this post in threaded view
|

RE: Re: Drawing on dialogues

bh77a-3
Sorry, I meant the test facilities provided within the main form of Plua
(what you see when you first launch it).

Oddly enough, after experimenting some more today, the graphics commands
do seem to work...

On Tue, 2007-03-27 at 20:10 +0000, Blake Winton wrote:

> What do you (Am) mean by "the main form testing area"?
>
> I've got some code that seems to work fine at
> http://bwinton.latte.ca/bzr/Plua/src/
> (Specifically, "Plua Sorting.lua" calls various Plua 2 drawing funcs.
> i.e. gui.menu, screen.moveto, screen.line...)
>
> (Oh, wait that's what you meant by "main form testing area"?)
>
> My only other thought is that you probably want to shift your
> screen.line into the gui.event handler, along the lines of:
>
> -- Main Loop
> while 1 do
> ev,id=gui.event()
> if ev==frmDrawForm then
> -- put your drawing code here...
> elseif ev==ctlSelect then
> -- put your button handling code here...
>
> Actually, nevermind that. It totally didn't work. But oddly, the
> following code did something when I tapped:
>
> gui.dialog(0,32,312,281,"title")
> while 1 do
> ev,id = gui.event()
> screen.line(60,0,60,80)
> if ev==appStop then
> break
> end
> end
>
> (I'm sure I'm doing something bad there by not destroying my dialog,
> but let's ignore that for now.)
>
> And, in fact, the following code worked just fine:
> gui.dialog(0,32,312,281,"title")
> ev,id = gui.event(0)
> screen.line(60,0,60,80)
> -- The next line is there to pause before exitting ev,id = gui.event()
>
> So there you go. You apparently need to pump the frmDrawForm event
> (which you can't see) before you start to draw your stuff.
>
> Later,
> Blake.
>
> > -----Original Message-----
> > From: [hidden email] [mailto:[hidden email]] On Behalf
> Of
> > Emil Tchekov
> > Sent: Tuesday, March 27, 2007 3:47 PM
> > To: [hidden email]
> > Subject: Re: [plua] Re: Drawing on dialogues
> >
> > That's why I am still using Plua 1. Plua 2 is still Beta...
> >
> > Am Montag, 26. März 2007 18:46 schrieb [hidden email]:
> > > Can someone confirm that the graphics commands don't seem to work
> at
> > > all. They work for me in the main form testing area, but that is
> > > it.
> > >
> > > I will experiment with this some more... this is very bad as if
> this
> > > doesn't work, I can't update Illusion to b7.
> > >
> > > > > > > gui.dialog(0,32,312,281,title)
> > > > > > > screen.line(160,0,160,30)
> > > > > > > gui.event
>
>
>
>
>  

Reply | Threaded
Open this post in threaded view
|

RE: Re: Drawing on dialogues

Berkant Atay
Hi,
I can now draw or print on formal dialog boxes. I
wonder why events such as frmDrawForm is not mentioned
in Plua2 documentation.. Are there many events like
this not covered in the events table in the
documentation?
Regards,
Berkant.

--- Brian Houghton <[hidden email]> wrote:

> Sorry, I meant the test facilities provided within
> the main form of Plua
> (what you see when you first launch it).
>
> Oddly enough, after experimenting some more today,
> the graphics commands
> do seem to work...
>
> On Tue, 2007-03-27 at 20:10 +0000, Blake Winton
> wrote:
> > What do you (Am) mean by "the main form testing
> area"?
> >
> > I've got some code that seems to work fine at
> > http://bwinton.latte.ca/bzr/Plua/src/
> > (Specifically, "Plua Sorting.lua" calls various
> Plua 2 drawing funcs.
> > i.e. gui.menu, screen.moveto, screen.line...)
> >
> > (Oh, wait that's what you meant by "main form
> testing area"?)
> >
> > My only other thought is that you probably want to
> shift your
> > screen.line into the gui.event handler, along the
> lines of:
> >
> > -- Main Loop
> > while 1 do
> > ev,id=gui.event()
> > if ev==frmDrawForm then
> > -- put your drawing code here...
> > elseif ev==ctlSelect then
> > -- put your button handling code here...
> >
> > Actually, nevermind that. It totally didn't work.
> But oddly, the
> > following code did something when I tapped:
> >
> > gui.dialog(0,32,312,281,"title")
> > while 1 do
> > ev,id = gui.event()
> > screen.line(60,0,60,80)
> > if ev==appStop then
> > break
> > end
> > end
> >
> > (I'm sure I'm doing something bad there by not
> destroying my dialog,
> > but let's ignore that for now.)
> >
> > And, in fact, the following code worked just fine:
> > gui.dialog(0,32,312,281,"title")
> > ev,id = gui.event(0)
> > screen.line(60,0,60,80)
> > -- The next line is there to pause before exitting
> ev,id = gui.event()
> >
> > So there you go. You apparently need to pump the
> frmDrawForm event
> > (which you can't see) before you start to draw
> your stuff.
> >
> > Later,
> > Blake.
> >
> > > -----Original Message-----
> > > From: [hidden email]
> [mailto:[hidden email]] On Behalf
> > Of
> > > Emil Tchekov
> > > Sent: Tuesday, March 27, 2007 3:47 PM
> > > To: [hidden email]
> > > Subject: Re: [plua] Re: Drawing on dialogues
> > >
> > > That's why I am still using Plua 1. Plua 2 is
> still Beta...
> > >
> > > Am Montag, 26. März 2007 18:46 schrieb
> [hidden email]:
> > > > Can someone confirm that the graphics commands
> don't seem to work
> > at
> > > > all. They work for me in the main form testing
> area, but that is
> > > > it.
> > > >
> > > > I will experiment with this some more... this
> is very bad as if
> > this
> > > > doesn't work, I can't update Illusion to b7.
> > > >
> > > > > > > > gui.dialog(0,32,312,281,title)
> > > > > > > > screen.line(160,0,160,30)
> > > > > > > > gui.event
> >
> >
> >
> >
> >  
>
>

Reply | Threaded
Open this post in threaded view
|

RE: Re: Drawing on dialogues

Blake Winton-3
> I wonder why events such as frmDrawForm is not mentioned in Plua2
> documentation..

My guess is because Plua doesn't return them to you from the
gui.event() method.  And I don't particularly think it should,
since in general, you don't care about most of them.  It's the
eternal trade-off between simplicity and flexibility.

> Are there many events like this not covered
> in the events table in the documentation?

Yes.

http://www.access-company.com/developers/documents/docs/palmos/PalmOSRef
erence/EventRef.html#996834

;)

Later,
Blake.