summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormdankov <mdankov@ffa7fe5e-494d-0410-b361-a75ebd5db220>2014-05-19 21:06:25 +0000
committermdankov <mdankov@ffa7fe5e-494d-0410-b361-a75ebd5db220>2014-05-19 21:06:25 +0000
commit6035ecc1c5e88a58f89303983de05b947cf7d044 (patch)
tree7a920f6c8d71ac4c1ccb73a58f360d7b62273cbb
parented27e483852b6920d8273b3d9546475f4c8b1fe3 (diff)
downloadnavit-svn-6035ecc1c5e88a58f89303983de05b947cf7d044.tar.gz
Add:graphics_win32:Allow to set initial window position with x and y attributes of <graphics> element. Accept "frame" attribute to manage presence of window frame (border). Fixes #1212.
git-svn-id: http://svn.code.sf.net/p/navit/code/trunk/navit@5778 ffa7fe5e-494d-0410-b361-a75ebd5db220
-rw-r--r--navit/graphics/win32/graphics_win32.c29
1 files changed, 23 insertions, 6 deletions
diff --git a/navit/graphics/win32/graphics_win32.c b/navit/graphics/win32/graphics_win32.c
index 41a43479..90408058 100644
--- a/navit/graphics/win32/graphics_win32.c
+++ b/navit/graphics/win32/graphics_win32.c
@@ -63,8 +63,11 @@ struct graphics_priv
struct navit *nav;
struct window window;
struct point p;
+ int x;
+ int y;
int width;
int height;
+ int frame;
int disabled;
HANDLE wnd_parent_handle;
HANDLE wnd_handle;
@@ -690,11 +693,16 @@ static HANDLE CreateGraphicsWindows( struct graphics_priv* gr, HMENU hMenu )
return NULL;
}
- if ( hMenu )
+ if(gr->frame)
{
- wStyle = WS_CHILD;
- } else {
- wStyle = WS_OVERLAPPED|WS_VISIBLE;
+ if ( hMenu )
+ {
+ wStyle = WS_CHILD;
+ } else {
+ wStyle = WS_OVERLAPPED|WS_VISIBLE;
+ }
+ } else {
+ wStyle = WS_VISIBLE | WS_POPUP | WS_CLIPSIBLINGS | WS_CLIPCHILDREN;
}
#ifdef HAVE_API_WIN32_CE
@@ -713,8 +721,8 @@ static HANDLE CreateGraphicsWindows( struct graphics_priv* gr, HMENU hMenu )
g_hwnd = hwnd = CreateWindow(g_szClassName,
TEXT("Navit"),
wStyle,
- 0,
- 0,
+ gr->x,
+ gr->y,
gr->width,
gr->height,
gr->wnd_parent_handle,
@@ -1644,6 +1652,15 @@ static struct graphics_priv*
return NULL;
this_=graphics_win32_new_helper(meth);
this_->nav=nav;
+ this_->frame=1;
+ if ((attr=attr_search(attrs, NULL, attr_frame)))
+ this_->frame=attr->u.num;
+ this_->x=0;
+ if ((attr=attr_search(attrs, NULL, attr_x)))
+ this_->x=attr->u.num;
+ this_->y=0;
+ if ((attr=attr_search(attrs, NULL, attr_y)))
+ this_->y=attr->u.num;
this_->width=792;
if ((attr=attr_search(attrs, NULL, attr_w)))
this_->width=attr->u.num;