1. #1
    Sencha User
    Join Date
    Mar 2007
    Posts
    40
    Vote Rating
    0
    davy_wei is on a distinguished road

      0  

    Default GXT web desktop widget window setPixelSize is not working...

    GXT web desktop widget window setPixelSize is not working...


    Hi,

    I should change the title to "How to set window pixel size?".

    I am trying to change the widget window open pixel size from (500, 400) to (800, 600). However, the window.setPixelSize(800,600) does not reflect the changes. Can anyone advise what I missed?

    Thanks

    -Lei

  2. #2
    Sencha - GXT Dev Team
    Join Date
    Feb 2009
    Location
    Minnesota
    Posts
    2,731
    Vote Rating
    90
    Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light

      0  

    Default


    There is no desktop-specific Window class, only the normal GXT Window class - can you be more specific about what you are using?

    Inside the Window, there is no code to set a max size - can you provide a sample that is demonstrating this issue, showing how you are creating and attempting to size the window?

    Additionally, by manually grabbing the window resize handles at http://www.sencha.com/examples/desktop.html I am not having any problem making the window larger than 800x600.

  3. #3
    Sencha User
    Join Date
    Mar 2007
    Posts
    40
    Vote Rating
    0
    davy_wei is on a distinguished road

      0  

    Default


    Colin, Thank you very much for replying me.

    I want to change the GXT web-desktop window widgets' sizes. The demoing web-desktop has a couple of widgets but all of them are the same initial size while openning. I am looking forward to changing the width and height of the Intercepter widget's initial window size. From the code, I found setPixelSize(500,400) in IntercepterViewImpl.getWindow() method. I tried to change the size to (800,600) but didn't see any size changes by just updating the setPixelSize(800,600) method. By Chrome DT, I see the size of the widget windows are actually (408, 339). The initial window openning sizes look always the same. I want to know the right way to adjust the size of the widgets in web-desktop. Thank you.

    I also tried the other resort, such as <uityle>, or setSize("800px", "600px"), but none of them worked. Please advise.

    Code:
      private Window getWindow() {
        if (window == null) {
          window = new Window();
          window.getHeader().setIcon(Images.getImageResources().script());
          window.setMinimizable(true);
          window.setMaximizable(true);
          window.setPixelSize(500, 400);
          window.setOnEsc(false);
          window.addHideHandler(this);
          window.addShowHandler(this);
          window.setWidget(getBorderLayoutContainer());
        }
        return window;
      }
    Screen Shot 2013-06-10 at 3.16.51 PM.jpg

  4. #4
    Sencha User
    Join Date
    Mar 2007
    Posts
    40
    Vote Rating
    0
    davy_wei is on a distinguished road

      0  

    Default setPixelSize is not working for setting the initial size of web desktop window widget

    setPixelSize is not working for setting the initial size of web desktop window widget


    Hi

    I want to change the GXT web-desktop window widgets' sizes. The demoing web-desktop has a couple of widgets but all of them are the same initial size while openning. I am looking forward to changing the width and height of the Intercepter widget's initial window size. From the code, I found setPixelSize(500,400) in IntercepterViewImpl.getWindow() method. I tried to change the size to (800,600) but didn't see any size changes by just updating the setPixelSize(800,600) method. By Chrome DT, I see the size of the widget windows are actually (408, 339). The initial window openning sizes look always the same. I want to know the right way to adjust the size of the widgets in web-desktop. Thank you.

    I also tried the other resort, such as <uityle>, or setSize("800px", "600px"), but none of them worked. Please help.

    Code:
      private Window getWindow() {
        if (window == null) {
          window = new Window();
          window.getHeader().setIcon(Images.getImageResources().script());
          window.setMinimizable(true);
          window.setMaximizable(true);
          window.setPixelSize(500, 400);
          window.setOnEsc(false);
          window.addHideHandler(this);
          window.addShowHandler(this);
          window.setWidget(getBorderLayoutContainer());
        }
        return window;
      }
    screenshot:
    http://www.sencha.com/forum/attachme...2&d=1370891859

  5. #5
    Sencha - GXT Dev Team
    Join Date
    Feb 2009
    Location
    Minnesota
    Posts
    2,731
    Vote Rating
    90
    Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light

      0  

    Default


    Merged - please don't file the same thread in more than one forum, or report code you don't understand as a bug. This isn't a bug, though it isn't clear either - write a simple app where *all* it does is draw a window, and you'll quickly see that sizes work just fine.

    So what is different here? Go back to http://www.sencha.com/examples/desktop.html and change your layout to something other than 'center' - the 'tile' setting seems to be the most noticeable. Why is the window sized differently? Next try this - arrange and size the windows as you like, and try resizing the window - why are they moving and resizing?

    The answer is that there is much more going on here than just the initial setup. Desktop is a complex example - that is the point, its a large build showing off lots of features. Each 'app' inside the desktop is divided into a presenter and a view, and when one is kicked off, we don't just call 'show()' directly - the view is passed of to something bigger, it is added to the Desktop itself, via Desktop.addWindow. (This is demonstrating a few different features of the MVP pattern as well as demonstrating how a relatively simple API can be written once and reused across each new piece as it is added.)

    This does several things, but the one directly associated here is addWindowHandler - it adds a com.sencha.gxt.desktop.client.widget.Desktop.WindowHandler handler to the window, so that it can listen to several events, and track the window as it is moved. (This is demonstrating how events can be used to tie different parts of the application together, and allow each piece to observe the others it is concerned with.)

    The show event handler calls the private method Desktop#showWindow which eventually passes off to DesktopLayout.layoutDesktop. DesktopLayout is an interface with several implementations, depending on which settings the user has configured. Each layout has its own way of positioning and sizing windows based on which window it is, where it is in the order of windows, what is happening (show, hide, resize, etc), and how big the desktop is. (This is demonstrating the delegate pattern, allowing several ways to do the same thing depending on circumstances or configuration).

    It is up to the layout implementation to decide how to render things. There are several constants defined in the interface, and each implementation can decide how to use those, or if it should use its own wiring.

    There are at least two ways to find this code - I took the approach of not even starting dev mode, by finding references of the 'getWindow()' method in one of the view impls. As it is private, it is only used inside the class, and only asWidget() exposes it to the outside. I then searched just for WordProcessorViewImpl (the sample 'app' i was reading) across the codebase, to see where asWidget() might be invoked. That took me to the presenter, WordProcessorPresenterImpl, with its createFileBasedMiniAppView() method, which is called in its superclass, where it is called by getFileBasedMiniAppView(). That method gets called by many places, but the most notable location was the go() method, which is part of the basic MVP structure being used in the desktop.

    From there we're getting into the what and the why. The why involves going into what MVP offers and why it is helpful to use interfaces to describe an app, so lets stick with what:

    The go(HasWidgets) method adds the view to this nebulous 'HasWidgets' object, which tells us only that it can handle several widgets. If you look at where go() is invoked, you find DesktopAppPresenterImpl.openFileModel as one location - when you click an icon, this is what gets launched to open that 'file' (the other location is what happens when you click the folder on the desktop). It passes in a DesktopAppView, of which there is one implementation, DesktopAppViewImpl. The add method in that implementation calls getDesktop().activate(widget), which kicks off the discussion above and results in the show handler.

    Remember, the desktop app is only an example, meant to demonstrate a few possible way to strucutre a large application. It is a) not a library, and b) not a finished product, as it can't do a lot by itself. If you do decide to use it as the 'starting point' for your application be sure to understand it before digging too far in, otherwise you may find yourself copying code in it without know why it does what it does.

  6. #6
    Sencha User
    Join Date
    Mar 2007
    Posts
    40
    Vote Rating
    0
    davy_wei is on a distinguished road

      0  

    Default Resolved

    Resolved


    Thanks Colin, I have the issue resolved by following your direction. I sneeded the code into LimitedDesktopLayout which is inherited by CenterDesktopLayout.

    Code:
        	if (requestWindow.getData(KEY_INITIAL_WIDTH) != null &&
        		requestWindow.getData(KEY_INITIAL_HEIGHT) != null) {
        		layoutWindow(requestWindow, containerWidth, containerHeight,
        				(Integer)requestWindow.getData(KEY_INITIAL_WIDTH),
        				(Integer)requestWindow.getData(KEY_INITIAL_HEIGHT));
        	} else {
        		layoutWindow(requestWindow, containerWidth, containerHeight, width, height);
        	}
    Sicne I am not able to retrieve requestWindow width and length directly in LimitedDesktopLayout, I leverage the setData and getData to build the connection between the Window widget and the layout. It now works for me.

    Thanks
    - Lei

  7. #7
    Sencha - GXT Dev Team
    Join Date
    Feb 2009
    Location
    Minnesota
    Posts
    2,731
    Vote Rating
    90
    Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light

      0  

    Default


    Another option would be to not use a layout at all, or to only have the layouts position the windows, and leave off any sizing - allow the window to size itself. Or, have the layout do nothing at all - this could be a new desktop layout implementation where the user is left to size and position the items.

  8. #8
    Ext GWT Premium Member
    Join Date
    Jun 2011
    Posts
    71
    Vote Rating
    0
    Aleksandar Krstik is on a distinguished road

      0  

    Default My solution

    My solution


    I know it's kind of an old post but I recently encountered this "issue" myself and wanted to share my solution:

    Instead of editing Sencha's classes which work just fine, I introduced a new layout which I called "NoneDesktopLayout". It might be a bit confusing as it's a layout that won't do any layout-ing but it was the fastest and least intrusive way to get to a manual layout while still keeping everything else the same.

    Specifically, in DesktopLayoutType.java I added an enum 'NONE', and in Desktop.java in the "private DesktopLayout createDesktopLayout(DesktopLayoutType desktopLayoutType)" method I added a case for "NONE" which creates a new "NoneDesktopLayout". And the NoneDesktopLayout.java that I created contains an empty layout method:
    Code:
    package com.sencha.gxt.desktop.client.layout;
    
    import com.google.gwt.user.client.Element;
    import com.sencha.gxt.widget.core.client.Window;
    
    public class NoneDesktopLayout implements DesktopLayout {
    
      @Override
      public DesktopLayoutType getDesktopLayoutType() {
        return DesktopLayoutType.NONE;
      }
    
      @Override
      public void layoutDesktop(Window requestWindow, RequestType requestType, Element element, Iterable<Window> windows,
          int width, int height) {
    
      }
    }
    I have also set the NONE layout to be the default in Desktop.java.

    By using this method the programmer has full control over window sizing and positioning, while still having the original CASCADE, CENTER, and TILE layouts working as before without changing any of their code.

    Just wanted to share, hopefully it helps someone.

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi