From fc3e2909a8d68f42b614acd7fcac25605985e37a Mon Sep 17 00:00:00 2001 From: Pritpal Bedi Date: Tue, 17 Jan 2012 01:35:26 +0000 Subject: [PATCH] 2012-01-16 17:32 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com) * contrib/gtwvg/gtwvg.c * contrib/gtwvg/gtwvg.h * contrib/gtwvg/hbgtwvg.ch + Implemented: HB_GTI_MAXIMIZABLE message. hb_gtInfo( HB_GTI_MAXIMIZABLE, TRUE/FALSE ) -> lPrevState TODO: implement in GTWVT if deemed fit. --- harbour/ChangeLog | 8 ++++++++ harbour/contrib/gtwvg/gtwvg.c | 26 ++++++++++++++++++++++++++ harbour/contrib/gtwvg/gtwvg.h | 1 + harbour/contrib/gtwvg/hbgtwvg.ch | 1 + 4 files changed, 36 insertions(+) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index c09ce75f8a..f037ca7e05 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -16,6 +16,14 @@ The license applies to all entries newer than 2009-04-28. */ +2012-01-16 17:32 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com) + * contrib/gtwvg/gtwvg.c + * contrib/gtwvg/gtwvg.h + * contrib/gtwvg/hbgtwvg.ch + + Implemented: HB_GTI_MAXIMIZABLE message. + hb_gtInfo( HB_GTI_MAXIMIZABLE, TRUE/FALSE ) -> lPrevState + TODO: implement in GTWVT if deemed fit. + 2012-01-16 16:50 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com) * contrib/gtwvg/gtwvg.c + Extended: hb_gtInfo( HB_GTI_SPEC, HB_GTS_SETPOSITION, [{x,y}] ) diff --git a/harbour/contrib/gtwvg/gtwvg.c b/harbour/contrib/gtwvg/gtwvg.c index d3dd25fe30..1faa97ca40 100644 --- a/harbour/contrib/gtwvg/gtwvg.c +++ b/harbour/contrib/gtwvg/gtwvg.c @@ -428,6 +428,7 @@ static PHB_GTWVT hb_gt_wvt_New( PHB_GT pGT, HINSTANCE hInstance, int iCmdShow ) pWVT->bSelectCopy = HB_TRUE; pWVT->bResizable = HB_TRUE; + pWVT->bMaximizable = HB_TRUE; pWVT->bClosable = HB_TRUE; { @@ -3441,6 +3442,31 @@ static HB_BOOL hb_gt_wvt_Info( PHB_GT pGT, int iType, PHB_GT_INFO pInfo ) } break; } + case HB_GTI_MAXIMIZABLE: + { + pInfo->pResult = hb_itemPutL( pInfo->pResult, pWVT->bMaximizable ); + if( pWVT->hWnd ) + { + if( pInfo->pNewVal ) + { + BOOL bMax = hb_itemGetL( pInfo->pNewVal ); + HB_GTWVT_LONG_PTR style = GetWindowLongPtr( pWVT->hWnd, GWL_STYLE ); + + if( bMax && ( ! pWVT->bMaximizable ) ) + { + style = style | WS_MAXIMIZEBOX; + } + else if( ( ! bMax ) && pWVT->bMaximizable ) + { + style = style & ~WS_MAXIMIZEBOX; + } + SetWindowLongPtr( pWVT->hWnd, GWL_STYLE, style ); + SetWindowPos( pWVT->hWnd, NULL, 0, 0, 0, 0, + SWP_NOACTIVATE | SWP_DRAWFRAME | SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER | SWP_DEFERERASE ); + } + } + break; + } case HB_GTI_RESIZABLE: pInfo->pResult = hb_itemPutL( pInfo->pResult, pWVT->bResizable ); if( pInfo->pNewVal ) diff --git a/harbour/contrib/gtwvg/gtwvg.h b/harbour/contrib/gtwvg/gtwvg.h index e8f7775c64..09cf0acf7f 100644 --- a/harbour/contrib/gtwvg/gtwvg.h +++ b/harbour/contrib/gtwvg/gtwvg.h @@ -394,6 +394,7 @@ typedef struct HB_BOOL bBeginMarked; HB_BOOL bResizable; + HB_BOOL bMaximizable; HB_BOOL bSelectCopy; void * hSelectCopy; diff --git a/harbour/contrib/gtwvg/hbgtwvg.ch b/harbour/contrib/gtwvg/hbgtwvg.ch index beac8cbea3..7a44afc7cf 100644 --- a/harbour/contrib/gtwvg/hbgtwvg.ch +++ b/harbour/contrib/gtwvg/hbgtwvg.ch @@ -86,6 +86,7 @@ #define HB_GTI_SETPOSANDSIZE 78 #define HB_GTI_REFRESH 79 #define HB_GTI_NOTIFIERBLOCKGUI 80 +#define HB_GTI_MAXIMIZABLE 81 /* Presentation Parameters | HB_GTI_PRESPARAMS */ #define HB_GTI_PP_EXSTYLE 1