[Gambas-user] Drawing Areas, painting on them, and printing the results...

Stephen sbungay at ...3301...
Wed Sep 3 17:14:12 CEST 2014


   Typographical error in the code (not that it is causing a problem). 
This line

   mDrawingAreaMatrix[X] = NEW DrawingArea(Panel1) AS "Card" & CInt(X)

CInt(X) is redundant and not at all what I was thinking about when I 
typed that line. It should more properly read;

   mDrawingAreaMatrix[X] = NEW DrawingArea(Panel1) AS "Card" & CStr(X)

   I'm beginning to think that what I am trying to accomplish is not 
possible. How can a Draw event that is not in the compile-time source be 
accessed during run-time?

On 09/03/2014 06:39 AM, Stephen wrote:
>   Attached is a sample project that dynamically instantiates 10 
> business card sized DrawingAreas within a Panel on a forum. The form 
> represents a North American letter-sized sheet of paper. Since the 
> Draw event must be used to draw within each of the Drawing areas, and 
> the the Drawing Areas are brought into existence at run-time, the 
> question is how to draw something on them?
>
>   The actual project uses a database to dynamically create (or 
> re-create) QR or Barcode images.
>
> Steve.
>
> On 09/02/2014 07:05 PM, Stephen wrote:
>> On 09/02/2014 06:22 PM, Jussi Lahtinen wrote:
>>>> I guess it is the need to use the draw event in order to do anything
>>>> with the drawing area that had me spun. I think in terms of methods,
>>>> properties and events, but I do not think in terms of events being the
>>>> very thing that actually does the work.
>>>>
>>> Draw event is called every time drawingarea needs to be drawn.
>>      Yes, so we force the event by the refresh method. I'm slowly making
>> progress... documenting things as I go. Thank you taking the time to 
>> help.
>>
>>> Thus it is
>>> where you put the drawing commands.
>>>
>>> But you can change this behavior by setting Cached property to True.
>>> Then you start painting by determining painting device (Gambas 
>>> cannot know
>>> where to draw, if you are not in specific drawing event)
>>> Paint.Begin(hNameOfPaintingDevice) and end with Paint.End.
>>> See the documentation.
>>>
>>>
>>>
>>>
>>>> I'm thinking of it now in terms of Macros, using the Object.Call(me,
>>>> $sFunctionName) treats the code in $sFunctionName like a Macro, (am 
>>>> I on
>>>> the right track?) Flexible&   powerful yes. Intuitive in it's 
>>>> usage, not
>>>> so much.
>>>>
>>> This only enables you to use string value to call a function. There are
>>> many alternatives for this.
>>>
>>>
>>>
>>>
>>>> One of the things that really confused me was the paint.reset command
>>>> telling me it had no device.... ummm... no "device"? To me a device 
>>>> is a
>>>> piece of hardware, a printer, a modem, a screen, keyboard, mouse,
>>>> soundcard, NIC, Com port etc.
>>> In Unix/Linux device has bit broader meaning, see example /dev/null or
>>> /dev/random. Not all devices are physical devices.
>>>
>>>
>>>
>>>
>>>> BTW, how does reset differ from clear?
>>>>
>>> http://gambaswiki.org/wiki/comp/gb.qt4/drawingarea/clear
>>> http://gambaswiki.org/wiki/comp/gb.qt4/paint/reset
>>>
>>>
>>>
>>> Jussi
>>> ------------------------------------------------------------------------------ 
>>>
>>> Slashdot TV.
>>> Video for Nerds.  Stuff that matters.
>>> http://tv.slashdot.org/
>>> _______________________________________________
>>> Gambas-user mailing list
>>> Gambas-user at lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/gambas-user
>>>
>>
>
>
> ------------------------------------------------------------------------------
> Slashdot TV.
> Video for Nerds.  Stuff that matters.
> http://tv.slashdot.org/
>
>
> _______________________________________________
> Gambas-user mailing list
> Gambas-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user


-- 
Kindest Regards
Stephen A. Bungay, Prop.
Smarts On Site Information Systems




More information about the User mailing list