suwit
March 21, 2008, 4:51am
1
hi,
i have problem with GoRulerCusor , cause of even if i press scrollbar up/down cursor not tracking object position correctly.
public void UpdateGoRulerCursor(RectangleF rect) {
GoRuler topRuler = this._goView.TopBar as GoRuler;
IEnumerable ienum = topRuler.GetCursorEnumerable();
IEnumerator itr = ienum.GetEnumerator();
if (itr.MoveNext()) {
GoRulerCursor cursor = itr.Current as GoRulerCursor;
cursor.Value = rect.Location.X ;
}
GoRuler leftRuler = this._goView.LeftBar as GoRuler;
ienum = leftRuler.GetCursorEnumerable();
itr = ienum.GetEnumerator();
if (itr.MoveNext()) {
GoRulerCursor cursor = itr.Current as GoRulerCursor;
cursor.Value = rect.Top;
}
}
protected void goView_DocumentChanged(Object sender, GoChangedEventArgs evt)
{
if (evt.Hint == GoDocument.ChangedTopLeft) {
} else if (evt.Hint == GoDocument.ChangedSize) {
} else if (evt.Hint == GoDocument.ChangedObject) {
switch (evt.SubHint) {
case GoObject.ChangedBounds: {
UpdateGoRulerCursor(evt.NewRect);
break;
}
}
}
Thanks,
Suwit A.
Jake
March 24, 2008, 10:19am
2
Are you having a problem just when you scroll?
Jake
March 24, 2008, 10:24am
3
Please add a company email address to your profile.
suwit
March 25, 2008, 11:11am
4
Hi,
Yes, I have a problem when scrolling up/down/Left/Right the currsor not works properly with currently node's position. So please post me some sample to solve this.
Thanks,
Suwit
Jake
March 25, 2008, 12:34pm
5
OK, you want to track the view property event with hints for DocPosition and DocScaleā¦
walter
March 25, 2008, 12:46pm
6
I think Jake means the GoView.PropertyChanged event.
suwit
March 25, 2008, 2:21pm
7
Could you please post me some sample ?
Thanks,
Suwit
Jake
March 25, 2008, 3:34pm
8
private void goView1_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e) { if (e.PropertyName == "DocPosition" || e.PropertyName == "DocScale") { // .... update ruler ....
} }
suwit
March 26, 2008, 11:35am
9
Thank Jake,
The sample too short not enought information to done on this. Because
My boss, he just wants to know how it's work?
We have plan to upgrade to 2.6 or 3.0 in very near future.
If i could not complete on this issue, may be the plan to upgrade might be NOT proceed.
Suwit A.
Jake
March 26, 2008, 2:07pm
10
You add this to your view class. It gets called when the DocPosition changes (e.g. on a scroll) and also when the DocScale changes.
See examples of this override in Demo1, Flowcharter, OrgCharter and ProtoApp.