Home » Eclipse Projects » Standard Widget Toolkit (SWT) » maximize shell
maximize shell [message #731704] |
Sun, 02 October 2011 11:38  |
Eclipse User |
|
|
|
Originally posted by: Prasanth Ravi
hi i want to know how to control the maximum size of a shell(the main
one in my case).
I currently use this method -->
private Shell sh;
public void controlResized(ControlEvent e) {
Rectangle rt=((Shell) e.widget).getBounds();
if(rt.height>500)
sh.setBounds(rt.x,rt.y, rt.width, 500);
}
However this results in flickering ,
the shell has the setMinimumsize() , but how do i do it to restrict a
window's height on resizing?
|
|
| | |
Re: maximize shell [message #731830 is a reply to message #731807] |
Mon, 03 October 2011 05:02   |
Eclipse User |
|
|
|
ohh sorry
there is a bug entry for this
https://bugs.eclipse.org/bugs/show_bug.cgi?id=74001
its an old one, re opened again,this seems to be a genuine request and i don't know why it took so long..the fix also seems to be simple,which can be done in
LRESULT WM_GETMINMAXINFO (int /*long*/ wParam, int /*long*/ lParam) {
LRESULT result = super.WM_GETMINMAXINFO (wParam, lParam);
if (result != null) return result;
if (minWidth != SWT.DEFAULT || minHeight != SWT.DEFAULT) {
MINMAXINFO info = new MINMAXINFO ();
OS.MoveMemory (info, lParam, MINMAXINFO.sizeof);
if (minWidth != SWT.DEFAULT) info.ptMinTrackSize_x = minWidth;
//CHANGE ADD if (minWidth != SWT.DEFAULT) info.ptMaxTrackSize_x = maxWidth;
if (minHeight != SWT.DEFAULT) info.ptMinTrackSize_y = minHeight;
//CHANGE ADD if (minWidth != SWT.DEFAULT) info.ptMaxTrackSize_y = maxHeight;
OS.MoveMemory (lParam, info, MINMAXINFO.sizeof);
return LRESULT.ZERO;
}
return result;
}
if the fix is urgent you can download the development release of the SWT and merge the related changes to rebuild SWT(may lead to more problems)
[Updated on: Mon, 03 October 2011 05:04] by Moderator
|
|
| |
Re: maximize shell [message #731861 is a reply to message #731830] |
Mon, 03 October 2011 06:23  |
Eclipse User |
|
|
|
On 10/3/2011 2:32 PM, vijay wrote:
> ohh sorry
>
> there is a bug entry for this
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=74001
>
> its an old one, re opened again,this seems to be a genuine request and i
> don't know why its taking so long..the fix also seems to be simple,which
> can be done in
>
> LRESULT WM_GETMINMAXINFO (int /*long*/ wParam, int /*long*/ lParam) {
> LRESULT result = super.WM_GETMINMAXINFO (wParam, lParam);
> if (result != null) return result;
> if (minWidth != SWT.DEFAULT || minHeight != SWT.DEFAULT) {
> MINMAXINFO info = new MINMAXINFO ();
> OS.MoveMemory (info, lParam, MINMAXINFO.sizeof);
> if (minWidth != SWT.DEFAULT) info.ptMinTrackSize_x = minWidth;
>
> //CHANGE ADD if (minWidth != SWT.DEFAULT) info.ptMaxTrackSize_x = maxWidth;
>
> if (minHeight != SWT.DEFAULT) info.ptMinTrackSize_y = minHeight;
>
> //CHANGE ADD if (minWidth != SWT.DEFAULT) info.ptMaxTrackSize_y =
> maxHeight;
>
> OS.MoveMemory (lParam, info, MINMAXINFO.sizeof);
> return LRESULT.ZERO;
> }
> return result;
> }
>
> if the fix is urgent you can download the development release of the SWT
> and merge the related changes to rebuild SWT(may lead to more problems)
thnx for the code .. i'll try it though i'm new to SWT. Meanwhile i
think i'll try to change so that i don't require that functionality and
i really don't want to go into the internals of SWT yet.
|
|
|
Re: maximize shell [message #731862 is a reply to message #731830] |
Mon, 03 October 2011 06:24  |
Eclipse User |
|
|
|
On 10/3/2011 2:32 PM, vijay wrote:
> ohh sorry
>
> there is a bug entry for this
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=74001
>
> its an old one, re opened again,this seems to be a genuine request and i
> don't know why its taking so long..the fix also seems to be simple,which
> can be done in
>
> LRESULT WM_GETMINMAXINFO (int /*long*/ wParam, int /*long*/ lParam) {
> LRESULT result = super.WM_GETMINMAXINFO (wParam, lParam);
> if (result != null) return result;
> if (minWidth != SWT.DEFAULT || minHeight != SWT.DEFAULT) {
> MINMAXINFO info = new MINMAXINFO ();
> OS.MoveMemory (info, lParam, MINMAXINFO.sizeof);
> if (minWidth != SWT.DEFAULT) info.ptMinTrackSize_x = minWidth;
>
> //CHANGE ADD if (minWidth != SWT.DEFAULT) info.ptMaxTrackSize_x = maxWidth;
>
> if (minHeight != SWT.DEFAULT) info.ptMinTrackSize_y = minHeight;
>
> //CHANGE ADD if (minWidth != SWT.DEFAULT) info.ptMaxTrackSize_y =
> maxHeight;
>
> OS.MoveMemory (lParam, info, MINMAXINFO.sizeof);
> return LRESULT.ZERO;
> }
> return result;
> }
>
> if the fix is urgent you can download the development release of the SWT
> and merge the related changes to rebuild SWT(may lead to more problems)
thnx for the code .. i'll try it though i'm new to SWT. Meanwhile i
think i'll try to change so that i don't require that functionality and
i really don't want to go into the internals of SWT yet.
|
|
|
Re: maximize shell [message #731863 is a reply to message #731830] |
Mon, 03 October 2011 06:25  |
Eclipse User |
|
|
|
On 10/3/2011 2:32 PM, vijay wrote:
> ohh sorry
>
> there is a bug entry for this
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=74001
>
> its an old one, re opened again,this seems to be a genuine request and i
> don't know why its taking so long..the fix also seems to be simple,which
> can be done in
>
> LRESULT WM_GETMINMAXINFO (int /*long*/ wParam, int /*long*/ lParam) {
> LRESULT result = super.WM_GETMINMAXINFO (wParam, lParam);
> if (result != null) return result;
> if (minWidth != SWT.DEFAULT || minHeight != SWT.DEFAULT) {
> MINMAXINFO info = new MINMAXINFO ();
> OS.MoveMemory (info, lParam, MINMAXINFO.sizeof);
> if (minWidth != SWT.DEFAULT) info.ptMinTrackSize_x = minWidth;
>
> //CHANGE ADD if (minWidth != SWT.DEFAULT) info.ptMaxTrackSize_x = maxWidth;
>
> if (minHeight != SWT.DEFAULT) info.ptMinTrackSize_y = minHeight;
>
> //CHANGE ADD if (minWidth != SWT.DEFAULT) info.ptMaxTrackSize_y =
> maxHeight;
>
> OS.MoveMemory (lParam, info, MINMAXINFO.sizeof);
> return LRESULT.ZERO;
> }
> return result;
> }
>
> if the fix is urgent you can download the development release of the SWT
> and merge the related changes to rebuild SWT(may lead to more problems)
thnx for the code .. i'll try it though i'm new to SWT. Meanwhile i
think i'll try to change so that i don't require that functionality and
i really don't want to go into the internals of SWT yet.
|
|
|
Re: maximize shell [message #731864 is a reply to message #731830] |
Mon, 03 October 2011 06:23  |
Eclipse User |
|
|
|
On 10/3/2011 2:32 PM, vijay wrote:
> ohh sorry
>
> there is a bug entry for this
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=74001
>
> its an old one, re opened again,this seems to be a genuine request and i
> don't know why its taking so long..the fix also seems to be simple,which
> can be done in
>
> LRESULT WM_GETMINMAXINFO (int /*long*/ wParam, int /*long*/ lParam) {
> LRESULT result = super.WM_GETMINMAXINFO (wParam, lParam);
> if (result != null) return result;
> if (minWidth != SWT.DEFAULT || minHeight != SWT.DEFAULT) {
> MINMAXINFO info = new MINMAXINFO ();
> OS.MoveMemory (info, lParam, MINMAXINFO.sizeof);
> if (minWidth != SWT.DEFAULT) info.ptMinTrackSize_x = minWidth;
>
> //CHANGE ADD if (minWidth != SWT.DEFAULT) info.ptMaxTrackSize_x = maxWidth;
>
> if (minHeight != SWT.DEFAULT) info.ptMinTrackSize_y = minHeight;
>
> //CHANGE ADD if (minWidth != SWT.DEFAULT) info.ptMaxTrackSize_y =
> maxHeight;
>
> OS.MoveMemory (lParam, info, MINMAXINFO.sizeof);
> return LRESULT.ZERO;
> }
> return result;
> }
>
> if the fix is urgent you can download the development release of the SWT
> and merge the related changes to rebuild SWT(may lead to more problems)
thnx for the code .. i'll try it though i'm new to SWT. Meanwhile i
think i'll try to change so that i don't require that functionality and
i really don't want to go into the internals of SWT yet.
|
|
|
Re: maximize shell [message #731865 is a reply to message #731830] |
Mon, 03 October 2011 06:24  |
Eclipse User |
|
|
|
On 10/3/2011 2:32 PM, vijay wrote:
> ohh sorry
>
> there is a bug entry for this
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=74001
>
> its an old one, re opened again,this seems to be a genuine request and i
> don't know why its taking so long..the fix also seems to be simple,which
> can be done in
>
> LRESULT WM_GETMINMAXINFO (int /*long*/ wParam, int /*long*/ lParam) {
> LRESULT result = super.WM_GETMINMAXINFO (wParam, lParam);
> if (result != null) return result;
> if (minWidth != SWT.DEFAULT || minHeight != SWT.DEFAULT) {
> MINMAXINFO info = new MINMAXINFO ();
> OS.MoveMemory (info, lParam, MINMAXINFO.sizeof);
> if (minWidth != SWT.DEFAULT) info.ptMinTrackSize_x = minWidth;
>
> //CHANGE ADD if (minWidth != SWT.DEFAULT) info.ptMaxTrackSize_x = maxWidth;
>
> if (minHeight != SWT.DEFAULT) info.ptMinTrackSize_y = minHeight;
>
> //CHANGE ADD if (minWidth != SWT.DEFAULT) info.ptMaxTrackSize_y =
> maxHeight;
>
> OS.MoveMemory (lParam, info, MINMAXINFO.sizeof);
> return LRESULT.ZERO;
> }
> return result;
> }
>
> if the fix is urgent you can download the development release of the SWT
> and merge the related changes to rebuild SWT(may lead to more problems)
thnx for the code .. i'll try it though i'm new to SWT. Meanwhile i
think i'll try to change so that i don't require that functionality and
i really don't want to go into the internals of SWT yet.
|
|
|
Re: maximize shell [message #731866 is a reply to message #731830] |
Mon, 03 October 2011 06:25  |
Eclipse User |
|
|
|
On 10/3/2011 2:32 PM, vijay wrote:
> ohh sorry
>
> there is a bug entry for this
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=74001
>
> its an old one, re opened again,this seems to be a genuine request and i
> don't know why its taking so long..the fix also seems to be simple,which
> can be done in
>
> LRESULT WM_GETMINMAXINFO (int /*long*/ wParam, int /*long*/ lParam) {
> LRESULT result = super.WM_GETMINMAXINFO (wParam, lParam);
> if (result != null) return result;
> if (minWidth != SWT.DEFAULT || minHeight != SWT.DEFAULT) {
> MINMAXINFO info = new MINMAXINFO ();
> OS.MoveMemory (info, lParam, MINMAXINFO.sizeof);
> if (minWidth != SWT.DEFAULT) info.ptMinTrackSize_x = minWidth;
>
> //CHANGE ADD if (minWidth != SWT.DEFAULT) info.ptMaxTrackSize_x = maxWidth;
>
> if (minHeight != SWT.DEFAULT) info.ptMinTrackSize_y = minHeight;
>
> //CHANGE ADD if (minWidth != SWT.DEFAULT) info.ptMaxTrackSize_y =
> maxHeight;
>
> OS.MoveMemory (lParam, info, MINMAXINFO.sizeof);
> return LRESULT.ZERO;
> }
> return result;
> }
>
> if the fix is urgent you can download the development release of the SWT
> and merge the related changes to rebuild SWT(may lead to more problems)
thnx for the code .. i'll try it though i'm new to SWT. Meanwhile i
think i'll try to change so that i don't require that functionality and
i really don't want to go into the internals of SWT yet.
|
|
|
Re: maximize shell [message #731867 is a reply to message #731830] |
Mon, 03 October 2011 06:40  |
Eclipse User |
|
|
|
thnx for the code :)
merging the changes however seems like an extreme step and since im new to SWT.. i don't want to break anything i can't fix considering it's SWT internals.
|
|
|
Goto Forum:
Current Time: Wed Jul 23 11:48:08 EDT 2025
Powered by FUDForum. Page generated in 0.05228 seconds
|