Home » Eclipse Projects » Standard Widget Toolkit (SWT) » maximize shell
maximize shell [message #731704] |
Sun, 02 October 2011 15: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 #731807 is a reply to message #731785] |
Mon, 03 October 2011 06:53 |
Eclipse User |
|
|
|
Originally posted by: Prasanth Ravi
On 10/3/2011 9:47 AM, vijay wrote:
> Did u try shell.setFullScren(true)?
i want to limit the size of the shell when the user tries to resize( ie
the shell should have a maximum size).
|
|
|
Re: maximize shell [message #731830 is a reply to message #731807] |
Mon, 03 October 2011 09:02 |
Vijay Raj Messages: 608 Registered: July 2009 |
Senior Member |
|
|
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)
---------------------
why, mr. Anderson, why, why do you persist?
Because I Choose To.
Regards,
Vijay
[Updated on: Mon, 03 October 2011 09:04] Report message to a moderator
|
|
| |
Re: maximize shell [message #731861 is a reply to message #731830] |
Mon, 03 October 2011 10:23 |
Prasanth Ravi Messages: 8 Registered: October 2011 |
Junior Member |
|
|
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 10:24 |
Prasanth Ravi Messages: 8 Registered: October 2011 |
Junior Member |
|
|
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 10:25 |
Prasanth Ravi Messages: 8 Registered: October 2011 |
Junior Member |
|
|
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 10:23 |
Prasanth Ravi Messages: 8 Registered: October 2011 |
Junior Member |
|
|
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 10:24 |
Prasanth Ravi Messages: 8 Registered: October 2011 |
Junior Member |
|
|
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 10:25 |
Prasanth Ravi Messages: 8 Registered: October 2011 |
Junior Member |
|
|
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.
|
|
| |
Goto Forum:
Current Time: Fri Apr 26 14:09:19 GMT 2024
Powered by FUDForum. Page generated in 0.06358 seconds
|