3
//GNOME Do is the legal property of its developers. Please refer to the
4
//COPYRIGHT file distributed with this
7
// This program is free software; you can redistribute it and/or modify
8
// it under the terms of the GNU General Public License as published by
9
// the Free Software Foundation; either version 2 of the License, or
10
// (at your option) any later version.
12
// This program is distributed in the hope that it will be useful,
13
// but WITHOUT ANY WARRANTY; without even the implied warranty of
14
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
// GNU General Public License for more details.
17
// You should have received a copy of the GNU General Public License
18
// along with this program; if not, write to the Free Software
19
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
31
public class PositionWindow
34
private Gtk.Window w, r;
36
public PositionWindow (Gtk.Window main, Gtk.Window results) {
41
Display disp = w.Screen.Display;
42
disp.GetPointer(out point.X, out point.Y);
44
monitor = w.Screen.GetMonitorAtPoint (point.X, point.Y);
47
public void UpdatePosition (int iconboxWidth, Pane currentPane,
48
Rectangle resultsOffset) {
49
Gdk.Rectangle geo, main, results;
51
w.GetPosition (out main.X, out main.Y);
52
w.GetSize (out main.Width, out main.Height);
54
//only change monitors if we are currently not showing the window
59
geo = w.Screen.GetMonitorGeometry (monitor);
60
main.X = ((geo.Width - main.Width) / 2) + geo.X;
61
main.Y = (int)((geo.Height + geo.Y - main.Height) / 2.5) + geo.Y;
62
w.Move (main.X, main.Y);
64
//position resultsWindow
65
r.GetSize (out results.Width, out results.Height);
66
results.Y = main.Y + main.Height + resultsOffset.Y;
67
results.X = main.X + iconboxWidth * (int) currentPane +
69
r.Move (results.X, results.Y);
71
//uncomment here to get debug output
72
//Console.WriteLine ("Repostion Started For Montior {0}:", monitor);
73
//Console.WriteLine ("Geo: Width-{0}, Height-{1}, X-{2}, Y-{3}",geo.Width, geo.Height, geo.X, geo.Y);
74
//Console.WriteLine ("Main: Width-{0}, Height-{1}, X-{2}, Y-{3}",main.Width, main.Height, main.X, main.Y);
77
public bool GetMonitor () {
82
Display disp = w.Screen.Display;
83
disp.GetPointer(out point.X, out point.Y);
85
monitor = w.Screen.GetMonitorAtPoint (point.X, point.Y);