Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Active-X friendly splitter - update
Message
From
11/05/2004 09:20:08
Mike Sue-Ping
Cambridge, Ontario, Canada
 
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00902333
Message ID:
00902791
Views:
48
Gerald,

I noticed the zip file attached, but (stupid me) I figured it was the same stuff I sent to you since it had the same filename. Anyway, I looked at the contents and ran the sample. IT WORKS GREAT! Now I just have to figure out how to reproduce the same in my real VFP form.

Thanks again for all the help. Fantastic work and excellect support. The UT can use a guy like you. <vbg>


Mike


>Check your mail, the zip is there since yesterday evening.
>Take a look at the resize() event of the form.
>
>If you allow your form to be resizable, you have to put some code in the resize event of the form to rearrange the controls.
>If you use the splitter, you just have to set the splitter.lCallResize property to .T. and the splitter will call thisform.resize() at the end of the split operation.
>
>Why? - When a browser is in a container and the size of the container change, the browser is not aware of the change until you call the refresh() of the container (BUG caused by the NODEFAULT in the refresh of the browser?).
>
>To make this long story short, the resize event of the form is called at each split operation, so its the best place to put all the code that deal with this issue. Set the size/position of the container, call container.refresh() and resize the browser inside of the container.
>
>
>*....
>
>*resize the container
>this.container1.top=0
>this.container1.height=this.Height
>this.container1.Left=this.splitter1.Left+this.splitter1.Width+1
>this.container1.Width=This.Width-this.container1.Left
>
>* tell the new container size to the browser!!
>this.container1.refresh()
>
>*resize the browser
>this.container1.Browser.top=2
>this.container1.browser.height=this.container1.height-4
>this.container1.browser.Left=2
>this.container1.browser.Width=this.container1.width-4
>
>*...
>
>
>HTH :)
>
>
>>Hi Gerald,
>>
>>I'm not sure what you are referring to in your post below. In step one "Resize the container", when am I supposed to do this? As I'm dragging the splitter over the container?
>>
>>If possible, can you modify the example to demonstrate the steps required to do the workaround?
>>
>>Thanks,
>>
>>Mike
>>
>>>FIRST:
>>>
>>>The workaround for your resizing issue is:
>>>1 - Resize the container
>>>2 - Call container.Refresh() <- this is the workaround!
>>>3 - resize the browser
>>>
>>>If you dont put the refresh before resizing the browser,
>>>the browser 'think' that the size of the container have not change
>>>and dont draw itself at the right position/dimension.
>>>
>>>HTH :-)
>>>
>>>SECOND:
>>>
>>>The name of the method is not really appropriate for the user point of view. I will rename it...
>>>
>>>The history is as follow:
>>>Internally, the 'left' and 'right' objects are hidden (.visible=.f.) to handle the drawing on the form behind the control window if the control is an active-x.
>>>
>>>If the form contain more active-x controls, those controls also need to be hidden.
>>>
>>>Thats why I have named the method ItemToHide().
>>>In this method, I populate an array of controls to 'hide' during the split operation.
>>>
>>>If you or someone else, have a better name for this method, feel free to tell me this name ASAP.
>>>
>>>I will update the class and zip files tomorrow.
>>>
>>>Regards :)
>>>
>>>>Gerald,
>>>>
>>>>I sent a response back to your email address. I'd included a modified version of your second splitter class that contains the ItemToHide method. What is this method supposed to do? Anyway, the issue still exists. It is related to the fact that the ActiveX control is within a VFP container object on the form.
>>>>
>>>>Regards,
>>>>
>>>>Mike
>>>>
>>>>PS. I like the quick "tech support" :)
>>>>
>>>>>Of course its quick :)
>>>>>
>>>>>Check your mail, I have sent a new class (only the left/right splitter is changed).
>>>>>
>>>>>You need to call the splitter.ItemToHide(oItem) in the init of the form to add your browser to the splitter show/hide pool.
>>>>>If it pass your test, I will update the other class and the doc in the download...
>>>>>
>>>>>HTH :)
>>>>>
>>>>>
>>>>>>I'll hold off sending you your modified sample then. It sounds like you know what the problem might be.
>>>>>>
>>>>>>Thanks for the quick attention to it.
>>>>>>
>>>>>>Mike
>>>>>>
>>>>>>>I can take a look at your code and I will come back later with a workaround.
>>>>>>>I already have an idea...
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>>The sample works file. I should have taken a closer look and realized that you were indeed using the browser control there. Having dug a little further into my code I see that I put my browser control into a VFP container object and that's when the splitter starts acting up.
>>>>>>>>
>>>>>>>>I modified your sample to reproduce the error. If you wish I could send it to you.
>>>>>>>>
>>>>>>>>Mike
>>>>>>>>
>>>>>>>>>I always like to have feedback :)
>>>>>>>>>
>>>>>>>>>Did the sample form work as expected in your system?
>>>>>>>>>The sample form contain a browser and an a treeview control and it work well on my system (W2K Server).
>>>>>>>>>
>>>>>>>>>You can post some code or send me your form for testing.
>>>>>>>>>You dont give enough info to debug...
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>>Hi Gerald,
>>>>>>>>>>
>>>>>>>>>>I tried your splitter class and ran into an issue as follows:
>>>>>>>>>>
>>>>>>>>>>I have a WebBrowser ActiveX control on a VFP8SP1 form running under Windows2000 Pro. In the browser control, I navigate to a HTML document. The splitter does not work when I drag it over the browser control. It disappears and does not respond to the mouseup event.
>>>>>>>>>>
>>>>>>>>>>Am I doing something wrong or was the splitter not designed to work with all ActiveX controls?
>>>>>>>>>>
>>>>>>>>>>TIA
>>>>>>>>>>
>>>>>>>>>>Mike
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>>If you already have downloaded this class, please re-download it.
>>>>>>>>>>>I have made some changes that improve the speed of the class.
>>>>>>>>>>>
>>>>>>>>>>>download#23455
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform