Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Suite Pro
  New Posts New Posts RSS Feed - GetClientRect returns wrong values
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

GetClientRect returns wrong values

 Post Reply Post Reply
Author
Message
blazej View Drop Down
Groupie
Groupie


Joined: 09 February 2005
Location: Canada
Status: Offline
Points: 53
Post Options Post Options   Thanks (0) Thanks(0)   Quote blazej Quote  Post ReplyReply Direct Link To This Post Topic: GetClientRect returns wrong values
    Posted: 09 February 2005 at 2:09pm
Hi

I'm in the process of evaluating Xtreme Suite for the purposes of the software project we're working on. I'm using the ActiveX version of the components in C# (VS .NET 2003).

I'm using both Command Bars and Docking Pane Manager. I want to create an SDI application do I have created a single document control on my main form. I'm trying to position it properly inside commandBars_ResizeEvent(). Here's what I do (copied straight from sample code):

int left, top, right, bottom;
commandBars.GetClientRect( out left, out top, out right, out bottom );
dataTableControl.SetBounds( left, top, right - left, bottom - top );

The problem is that commandBars.GetClientRect() returns unrealistic values: left=3090, top=345, right=9630, bottom=9030. Of course, the SetBounds() call is then positioning my document control well beyond the screen.

What's wrong?

Regards

     Michal Blazejczyk
Back to Top
SuperMario View Drop Down
Admin Group
Admin Group
Avatar

Joined: 14 February 2004
Status: Offline
Points: 18057
Post Options Post Options   Thanks (0) Thanks(0)   Quote SuperMario Quote  Post ReplyReply Direct Link To This Post Posted: 09 February 2005 at 2:23pm
Might need to add:

        private void frmMain_Load(object sender, System.EventArgs e)
        {
             ..............

           foreach (Control ctrl in this.Controls)
            {
         &nbs p;      if (ctrl is MdiClient)
                {                                                                       
                    CommandBars.SetMDIClient(ctrl.Handle.ToInt32());
                }
            }

             ..............
        }
Back to Top
blazej View Drop Down
Groupie
Groupie


Joined: 09 February 2005
Location: Canada
Status: Offline
Points: 53
Post Options Post Options   Thanks (0) Thanks(0)   Quote blazej Quote  Post ReplyReply Direct Link To This Post Posted: 09 February 2005 at 2:31pm
Hi

Yes, but my app is not MDI and none of my controls are MDI. Is this required by the Xtreme Suite?

What I did was following the example that I found in the DockingPane C# sample... It works there, why not in my case? The only difference is the presence of CommandBars...

Regards

     Michal
Back to Top
SuperMario View Drop Down
Admin Group
Admin Group
Avatar

Joined: 14 February 2004
Status: Offline
Points: 18057
Post Options Post Options   Thanks (0) Thanks(0)   Quote SuperMario Quote  Post ReplyReply Direct Link To This Post Posted: 09 February 2005 at 2:35pm
You can try:

    DockingPaneManager.SetCommandBars (CommandBars.GetDispatch());



Edited by SuperMario
Back to Top
blazej View Drop Down
Groupie
Groupie


Joined: 09 February 2005
Location: Canada
Status: Offline
Points: 53
Post Options Post Options   Thanks (0) Thanks(0)   Quote blazej Quote  Post ReplyReply Direct Link To This Post Posted: 09 February 2005 at 2:53pm
Yep, I'm doing that.

This behavior looks like a bug to me. I tried remove the command bars from the picture - dockingManager.GetClientRect() still returns way too big values.

But the DockingPane sample works fine :-(((

Michal
Back to Top
Boyd View Drop Down
Senior Member
Senior Member


Joined: 08 December 2003
Location: United States
Status: Offline
Points: 285
Post Options Post Options   Thanks (0) Thanks(0)   Quote Boyd Quote  Post ReplyReply Direct Link To This Post Posted: 09 February 2005 at 3:48pm
Try changing the scale mode of CommandBars and DockingPanes from Twips to Pixels.  It defaults to Twips, and that's probably what's giving you the large numbers.  I've been using all the controls in C# without problems.
Back to Top
blazej View Drop Down
Groupie
Groupie


Joined: 09 February 2005
Location: Canada
Status: Offline
Points: 53
Post Options Post Options   Thanks (0) Thanks(0)   Quote blazej Quote  Post ReplyReply Direct Link To This Post Posted: 09 February 2005 at 4:09pm
Thanks, that was it!

Some strange default, I tell ya!

;)

Michal
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.172 seconds.