This project is read-only.

ZoomNavBar

Topics: Attention VFPX Admins
Oct 21, 2010 at 6:28 PM

Hi,

I'm trying to use ZoomNavBar in a Visual Maxframe Professional application.  I've dropped the Zoomnavbar on a form and put code to add the buttons.  This works, but I have a couple questions:

1. How do I tell it to inherit the windows theme that is currently set?

2. Loading buttons takes relatively long.  It takes almost 3 seconds running the addbutton code in a loop for 11 items.  Is this par for the course?

3. How do I get the Zoombar to display across the whole bottom of the for as per the sample form?  Mine is only showing partway across the form despite me having set the anchor property to stretch it across the bottom?

Thanks

Frank

Oct 21, 2010 at 8:14 PM

Hi Frank.

1. Set _screen.ThemesManager.InheritWindowsTheme to .T. Note, however, that not all Windows themes are represented in the ThemedControls.

2. Yes, it does seem slow. I haven't traced the code to find out why.

3. Set the Stretch property to .T.

Doug

Oct 21, 2010 at 10:32 PM

Thanks Doug.

The stretch works, but where/when do I set the InheritWindows property?  I've tried it in the Init of the ZoomNavBar but I get an error: Property CONTROLCOUNT is not found occurring in themesmanager.loopthroughcontrols() at line 24 For lnCnt = 1 to loRef.ControlCount.  This may be moot as the speed is unusable for my situation, but I'm still interested in understanding how it works so I can maybe use it elsewhere.

Oct 22, 2010 at 5:25 PM

Hi Frank.

I think you have to set it after DODEFAULT() because the ThemesManager is instantiated from Init.

Doug

Oct 22, 2010 at 5:31 PM

Thanks Doug,

but that's where I tried it and got the error.

Oct 24, 2010 at 1:06 PM

Anybody have any further suggestions on how to get this going?

Oct 24, 2010 at 3:49 PM

Frank,

 

it would help if you specify which error you received.

Koen

Oct 24, 2010 at 7:24 PM
Edited Oct 24, 2010 at 7:24 PM

Hi Koen,

I posted the error in an earlier post (the third message from the top), but here it is again for you:

I get an error: Property CONTROLCOUNT is not found occurring in themesmanager.loopthroughcontrols() at line 24 For lnCnt = 1 to loRef.ControlCount.

It seems to be some kind of problem between Visual MaxFrame Professional (VMP) and ZoomNavBar.  If I put the code in a standard VFP base form it works fine (beside it being slow).

Here is the code I was trying in the init of a zoombar on a form:

I get an error: Property CONTROLCOUNT is not found occurring in themesmanager.loopthroughcontrols() at line 24 For lnCnt = 1 to loRef.ControlCount.

DoDefault()

_Screen.ThemesManager.InheritWindowsTheme = .T.
lcPath = HOME() + "Graphics\Bitmaps\Gauge\"
lnBmps = ADIR(laBmps, m.lcPath + "*.bmp")

lnseconds = SECONDS()
FOR lnCount = 1 TO m.lnBmps
This.AddButton(JUSTSTEM(laBmps[lnCount, 1]), laBmps[lnCount, 1], m.lcPath + laBmps[lnCount, 1])
ENDFOR
lntime = SECONDS() - m.lnseconds
MESSAGEBOX(TRANSFORM(m.lntime) + " to load " + TRANSFORM(m.lnBmps) + " bmps")

Oct 24, 2010 at 7:36 PM
Edited Oct 24, 2010 at 7:49 PM

Now that I've tracked it down to being a problem between VMP and the zoombar, I think I see the problem in zoombar's code.

In themesmanager.loopthroughcontrols it is trying to reference loRef.ControlCount, but in this case it is unable to do so.  The loRef at this point in time refers to VMP's MsgSvc object.  Is it possible that the controlcount is protected or hidden and that the code needs to cater for that?

On the speed side, it looks like the createadditionalimages method is what causes it to be so slow.

Oct 25, 2010 at 4:29 PM

The problem is definitely due to the ControlCount being a protected property.  If I wrap the code in

IF NOT PEMSTATUS(loRef, "ControlCount", 2)

then the code runs.  Maybe this test needs to be added to the class.

Oct 25, 2010 at 5:01 PM

Hi,

 

Good catch.  Sorry I could not be of further assistance - dont have that particular framework installed.

Regards,

 

Koen