UBBFriend: Email This Page to Someone!
  Computer Workshop User Forums
  General Questions about EZGUI
  Controls, Hiding and Layers, Refresh Speed

Post New Topic  Post A Reply
profile | register | preferences | faq | search

next newest topic | next oldest topic
Author Topic:   Controls, Hiding and Layers, Refresh Speed
Dan Gin zel
Member
posted 04-03-2007 04:18 PM     Click Here to See the Profile for Dan Gin zel     Edit/Delete Message Reply w/Quote
Chris, I've done it once again. I've got a dialog with lots of controls and could use some advice on how to make the controls update more quickly.

My first question is in regards to hiding controls. I do not see anything in the API about this.

My personal guess is that you are changing the width of the control to zero while keeping the actual value in an array. What I'm seeing is when I hide something that is "wide" is something like an animation of the control getting 'closing' like a windowshade from right to left.

I am considering alternate methods, such as moving the control off the screen. Thoughts?

Also, is this same technique employed in layers? If so, what are some things that I could do to optimize your routines?

Just so that you can get a handle of what I'm working with, here are a few screen shots:

http://www.bullthumper.com/images/screenshot%201-1-111.png

http://www.bullthumper.com/images/screenshot%201-1-122shared.png

http://www.bullthumper.com/images/screenshot%203-2-1.png


Gary Stout
Member
posted 04-03-2007 05:20 PM     Click Here to See the Profile for Gary Stout     Edit/Delete Message Reply w/Quote
Dan,

Is that a 100% EZGUI app? It looks impressive!

I don't know if this is exactly what you are asking for, but have you taken a look at EZ_HIDEC and EZ_SHOWC to hide and show controls? This will allow a single or group of controls to be hidden and shown at the same time.

HTH,
Gary Stout

Dan Gin zel
Member
posted 04-03-2007 05:28 PM     Click Here to See the Profile for Dan Gin zel     Edit/Delete Message Reply w/Quote
Gary, yes it is 100% EZGUI using a combination of canvas controls, sprites and picture controls. Believe it or not, that was 13 days work to have a working application.

And yes, I am using the Hide and Show control commands all over the place in addition to the layers. Each top tab is layer 1, 2, 3 and 4. Each tab group on each page is 11, 21, 22, 31, 32, etc...

Speaking of which Chris, is there a way to increase the 99 layer limit to 999. It's not that I need 999 layers, but I would use it to keep my layers organized better. For example, layer 123 would be "Page 1", "Tab Group 2" and "3rd Tab Selected".

Gary Stout
Member
posted 04-03-2007 05:34 PM     Click Here to See the Profile for Gary Stout     Edit/Delete Message Reply w/Quote
quote:
Originally posted by Dan Gin zel:
Gary, yes it is 100% EZGUI using a combination of canvas controls, sprites and picture controls. Believe it or not, that was 13 days work to have a working application.

Very Cool! How are you controlling the external devices (mixer or whatever)?

Gary

Dan Gin zel
Member
posted 04-03-2007 05:45 PM     Click Here to See the Profile for Dan Gin zel     Edit/Delete Message Reply w/Quote
Via Ethernet (simple UDP) or USB (required for firmware updates). The software can communication with up to 24 base stations via Ethernet + 1 USB. It receives live status / usage information as well as controlling settings and even overriding speakers (Mic Kill.) For a fuller perspective of this proggy and what it controls, you see a copy of the press release at http://tinyurl.com/3ylram .

The only part of the program that is not (essentially) operational is the "All Systems" tab. I've still got to learn how to create a series of canvas controls (one per base station) that can be dragged-and-dropped into a layout of 3 columns x 9 rows. Oh well, it's still a week to NAB...

[This message has been edited by Dan Gin zel (edited 04-03-2007).]

Chris Boss
Administrator
posted 04-03-2007 06:06 PM     Click Here to See the Profile for Chris Boss     Edit/Delete Message Reply w/Quote
Dan,

Nothing changes when a control is hidden.

Windows tracks the current state of all windows (controls/forms) whether they are visible or not. This is done via the WS_VISIBLE window style. If a window (or its parent) does not have this style, then Windows treats the window as hidden.

When hiding or showing multiple windows at one time, you can get a flicker effect as each window is either shown or visible. The best results are when Windows requests that all the windows be repainted at the same time.

For example when you call the EZ_DisplayLayer command, it must hide/show many windows all at once. How does it doe this with as little flicker as posible?

It turns off the redraw state of the parent form, then hides/shows the controls as needed, resets the redraw state and then request that the entire form be repainted (includes the controls).

When you use the EZ_ShowC or EZ_HideC commands to do this, you can accomplish the same thing yourself. Use the EZ_SetRedrawState command to turn off the parent forms redraw state. Show and Hide controls as needed. Turn the redraw state back on and then force a repaint of the forn using the EZ_RedrawForm command.

Dan Gin zel
Member
posted 04-03-2007 06:16 PM     Click Here to See the Profile for Dan Gin zel     Edit/Delete Message Reply w/Quote
I used the EZ_SetRedrawState with great results on the frequency coordination program I wrote a few years back. It has over 800 controls. Of course if I knew what I knew now, I would be using more canvas' and, of course, sprites.

I guess what I'm seeing is what Windoze is doing under the hood. I'll just play with it and, if necessary, I'll employ more sprites. :-)

Chris Boss
Administrator
posted 04-03-2007 06:26 PM     Click Here to See the Profile for Chris Boss     Edit/Delete Message Reply w/Quote
I hope you don't mind, but I posted a link on the PB forums to this thread, so others can see your screen shots.

( http://www.powerbasic.com/support/forums/Forum8/HTML/003770.html )

Quite impressive if I say so myself!

Dan Gin zel
Member
posted 04-03-2007 07:05 PM     Click Here to See the Profile for Dan Gin zel     Edit/Delete Message Reply w/Quote
Not a problem. I'll be happy to provide you "final" shots, as well. ...anything I can to help illustrate how much I rely on EZGUI. And I wasn't kidding: I wrote that program in [u]under[/u] two weeks. Next week, it is to be on a highly visible LCD projector at the NAB show in 'Vegas as a part of the new product demonstration and introduction: A showcase for EZGUI indeed.

Anyhow, I've decided that the little bit of flicker is acceptable. I tried it on an 800 Mhz Win98SE machine and it was about the same as the 2002 model laptop I was testing this on.

Chris Boss
Administrator
posted 04-04-2007 12:11 PM     Click Here to See the Profile for Chris Boss     Edit/Delete Message Reply w/Quote
Dan,

As far as drag and drop, you may be better off using a single large Canvas, instead of multiple small ones and then drag and drop sprites onto it. Sprites are easier to work with as far as drag and drop, plus they support collision detection (you know what other sprite it was dropped on).

Chris Boss
Administrator
posted 04-04-2007 12:19 PM     Click Here to See the Profile for Chris Boss     Edit/Delete Message Reply w/Quote
Another thing to point out about drawing on the Canvas control:

"Dirty Rectangles"

Normally when you draw on the Canvas control, it updates the entire client area of the control for repainting (when you call EZ_EndDraw).

The EZ_CShowRect command can be used in the draw cycle (between EZ_StartDraw and EZ_EndDraw) to force the control to only repaint a section of the control. EZGUI will track every call to EZ_CShowRect during the draw cycle and will generate a region which is to be updated when EZ_EndDraw is called. Only the area within that region (multiple rectangles combined together) will be repainted. This can speed up redrawing the control when fast animation is done and will decrease some flicker.

Also the K (Clipping) property should be used on the parent form, otherwise the background behind controls (part of the form) is repainted before the control is. The K property decreases flicker too!

[This message has been edited by Chris Boss (edited 04-04-2007).]

Chris Boss
Administrator
posted 04-04-2007 12:24 PM     Click Here to See the Profile for Chris Boss     Edit/Delete Message Reply w/Quote
Take a look at the canvasth.bas sample program in the codeclips folder, to see EZ_CShowRect in use. It significantly speeds up the drawing of the Canvas control on the left of the form.

Russ Srole
Member
posted 04-04-2007 08:23 PM     Click Here to See the Profile for Russ Srole     Edit/Delete Message Reply w/Quote
Dan,

I'll be at NAB as well. Company name is Zaxel Systems, Inc. Booth SL14405. Are you in booth C5912? We should touch bases.

Russ Srole

Dan Gin zel
Member
posted 04-04-2007 11:22 PM     Click Here to See the Profile for Dan Gin zel     Edit/Delete Message Reply w/Quote
quote:
Originally posted by Russ Srole:
I'll be at NAB as well. Company name is Zaxel Systems, Inc. Booth SL14405. Are you in booth C5912? We should touch bases.

I haven't decided if I'm going to drive out to Vegas. If I do, it'll only be for a day. The software is quite simple and will (likely) be running in a demo mode because, well, let's just say thanks to EZGUI, the software is running ahead of the hardware. Anyhow, if I end up out there, I'll look you up. If you see a guy with a cowboy hat, Wranglers and all in your booth, it just might be me!

Russ Srole
Member
posted 04-05-2007 12:09 PM     Click Here to See the Profile for Russ Srole     Edit/Delete Message Reply w/Quote
Eee ahhh! I'll look for you.

Dan Gin zel
Member
posted 04-11-2007 01:18 AM     Click Here to See the Profile for Dan Gin zel     Edit/Delete Message Reply w/Quote
Okay, Russ, it has been decided that I will not be needed in 'Vegas and to go to Detroit instead. Part of the reason is that the hardware won't be ready and thus the software will be just a demo. Long story. Anyhow, I'm supposed to be in SoCal in June; perhaps we can catch up then. Check my profile for my email address to contact me directly.

All times are EST (US)

next newest topic | next oldest topic

Administrative Options: Close Topic | Archive/Move | Delete Topic
Post New Topic  Post A Reply
Hop to:

Contact Us | Computer Workshop ( EZGUI ) Home Page

Copyright 2000 to 2007 Christopher R. Boss

Powered by: Ultimate Bulletin Board, Version 5.44
© Infopop Corporation (formerly Madrona Park, Inc.), 1998 - 2000.