fxscrollwindow

View: New views
6 Messages — Rating Filter:   Alert me  

fxscrollwindow

by n d-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi again everyone. Quick question about FXScrollWindow: is it just me, or does the setPosition() function not work? whenever i call the call the function the scroll bar never moves. Any suggestions as to why this is happening?

-Nate

------------------------------------------------------------------------------
OpenSolaris 2009.06 is a cutting edge operating system for enterprises
looking to deploy the next generation of Solaris that includes the latest
innovations from Sun and the OpenSource community. Download a copy and
enjoy capabilities such as Networking, Storage and Virtualization.
Go to: http://p.sf.net/sfu/opensolaris-get
_______________________________________________
Foxgui-users mailing list
Foxgui-users@...
https://lists.sourceforge.net/lists/listinfo/foxgui-users

Re: fxscrollwindow

by Jeroen van der Zijp :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Tuesday 02 June 2009, n d wrote:
> Hi again everyone. Quick question about FXScrollWindow: is it just me, or
> does the setPosition() function not work? whenever i call the call the
> function the scroll bar never moves. Any suggestions as to why this is
> happening?

It may be due to the following causes:

        1) FXScrollWindow's child (contentWindow) has a size which is smaller than
           the FXScrollWindow's viewport.  Obviously, in such a case it never needs
           scrolling.  Depending on the flags, scrollbars may or may not be visible.
       
        2) You've turned scrolling off.

        3) The contentWindow's layout hints are such (e.g. LAYOUT_FILL_X or LAYOUT_FILL_Y)
           that it will be placed to fill the viewport area.

        4) It does scroll, but has no change to repaint.


These are some of the things I can think off...

               
                - Jeroen



--
+----------------------------------------------------------------------------+
| Copyright (C) 23:30 06/ 2/2009 Jeroen van der Zijp.   All Rights Reserved. |
+----------------------------------------------------------------------------+

------------------------------------------------------------------------------
OpenSolaris 2009.06 is a cutting edge operating system for enterprises
looking to deploy the next generation of Solaris that includes the latest
innovations from Sun and the OpenSource community. Download a copy and
enjoy capabilities such as Networking, Storage and Virtualization.
Go to: http://p.sf.net/sfu/opensolaris-get
_______________________________________________
Foxgui-users mailing list
Foxgui-users@...
https://lists.sourceforge.net/lists/listinfo/foxgui-users

Re: fxscrollwindow

by n d-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Thanks for the quick response. I think if anything, the 4th problem listed might be it. The scrollbars do show up, and I can scroll them with the mouse, but the point of what im doing is to set the placement with setPosition(). In any event, I still don't know how to solve the problem >_<.

2009/6/3 Jeroen van der Zijp <jeroen@...>
On Tuesday 02 June 2009, n d wrote:
> Hi again everyone. Quick question about FXScrollWindow: is it just me, or
> does the setPosition() function not work? whenever i call the call the
> function the scroll bar never moves. Any suggestions as to why this is
> happening?

It may be due to the following causes:

       1) FXScrollWindow's child (contentWindow) has a size which is smaller than
          the FXScrollWindow's viewport.  Obviously, in such a case it never needs
          scrolling.  Depending on the flags, scrollbars may or may not be visible.

       2) You've turned scrolling off.

       3) The contentWindow's layout hints are such (e.g. LAYOUT_FILL_X or LAYOUT_FILL_Y)
          that it will be placed to fill the viewport area.

       4) It does scroll, but has no change to repaint.


These are some of the things I can think off...


               - Jeroen



--
+----------------------------------------------------------------------------+
| Copyright (C) 23:30 06/ 2/2009 Jeroen van der Zijp.   All Rights Reserved. |
+----------------------------------------------------------------------------+


------------------------------------------------------------------------------
OpenSolaris 2009.06 is a cutting edge operating system for enterprises
looking to deploy the next generation of Solaris that includes the latest
innovations from Sun and the OpenSource community. Download a copy and
enjoy capabilities such as Networking, Storage and Virtualization.
Go to: http://p.sf.net/sfu/opensolaris-get
_______________________________________________
Foxgui-users mailing list
Foxgui-users@...
https://lists.sourceforge.net/lists/listinfo/foxgui-users

Re: fxscrollwindow

by n d-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

It seems that setPosition actually is working, but the function that updates the position of the scrollbar is being called art the wrong time. the idea is that it is continuously called, so for FXMAPFUNC i used the message type as SEL_UPDATE. However, it seems the widget is only updated when the mouse moves over it in an up or down fashion. Any reason why this might happen? I will also provide code if that is at all helpful. Also, how does one tell when the scroller has reached the end of the scrollbar?

Here is the widget I am trying to make:


class newWidget: public FXHorizontalFrame
{
  FXDECLARE(newWidget)

  protected:
    newWidget(){}
    FXLabel* label;
    FXScrollWindow* scroll;
    FXString text;
   
    FXString adjustText(FXString labelText)
    {
      // this might need work later on
      double w = scroll->getWidth();
      w *= 1.5;
     
      for(int l = 0; l < (w/2); l++)
      {
        if(l < (w/4))
        {
          labelText.prepend(" ");
         
        }
        else
        {
          labelText.append(" ");
        }
      }
      return labelText;
    }
   
  public:
   
    newWidget(FXComposite* p,FXObject* tgt=NULL,FXSelector sel=0, FXString labelText="", FXuint opts=0,FXint x=0,FXint y=0,FXint w=0,FXint h=0,FXint pl=DEFAULT_SPACING,FXint pr=DEFAULT_SPACING,FXint pt=DEFAULT_SPACING,FXint pb=DEFAULT_SPACING,FXint hs=DEFAULT_SPACING,FXint vs=DEFAULT_SPACING):
        FXHorizontalFrame(p,opts,x,y,w,h,pl,pr,pt,pb,hs,vs)
    {
      scroll = new FXScrollWindow(this,opts|VSCROLLING_OFF|HSCROLLER_NEVER,x,y,w,h);
      label = new FXLabel(scroll,adjustText(labelText),0,opts,x,y,w,h,pl,pr,pt,pb);
      text = labelText;
      target = tgt;
      message = sel;
    }
     
      void setText(FXString labelText)
      {
      label->setText(adjustText(labelText));
      text = labelText;
    }
   
    void UpdText()
    {
      label->setText(adjustText(text));
    }
   
    void UpdPosition()
    {
      // need this to test if end of scrollbar is reached
      if(1 == 1)
      {
        int x = scroll->getXPosition();
        scroll->setPosition(x-2, 0);
      }
      else
      {
        scroll->setPosition(0, 0);
      }
    }
};


2009/6/3 Jeroen van der Zijp <jeroen@...>
On Tuesday 02 June 2009, n d wrote:
> Hi again everyone. Quick question about FXScrollWindow: is it just me, or
> does the setPosition() function not work? whenever i call the call the
> function the scroll bar never moves. Any suggestions as to why this is
> happening?

It may be due to the following causes:

       1) FXScrollWindow's child (contentWindow) has a size which is smaller than
          the FXScrollWindow's viewport.  Obviously, in such a case it never needs
          scrolling.  Depending on the flags, scrollbars may or may not be visible.

       2) You've turned scrolling off.

       3) The contentWindow's layout hints are such (e.g. LAYOUT_FILL_X or LAYOUT_FILL_Y)
          that it will be placed to fill the viewport area.

       4) It does scroll, but has no change to repaint.


These are some of the things I can think off...


               - Jeroen



--
+----------------------------------------------------------------------------+
| Copyright (C) 23:30 06/ 2/2009 Jeroen van der Zijp.   All Rights Reserved. |
+----------------------------------------------------------------------------+


------------------------------------------------------------------------------
OpenSolaris 2009.06 is a cutting edge operating system for enterprises
looking to deploy the next generation of Solaris that includes the latest
innovations from Sun and the OpenSource community. Download a copy and
enjoy capabilities such as Networking, Storage and Virtualization.
Go to: http://p.sf.net/sfu/opensolaris-get
_______________________________________________
Foxgui-users mailing list
Foxgui-users@...
https://lists.sourceforge.net/lists/listinfo/foxgui-users

FOX 1.6.36 and 1.7.19 Linux/X11 user-hostile bug

by Hal Brand :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

There is a nasty bug in FOX (1.6.36 and 1.7.16 and as best I can tell the whole 1.6.x. and 1.7.x series and maybe before) where, after a key press of a key that is mapped to an accelerator, FOX "grabs" the XServer and then ignores all mouse clicks and mouse motion if the window handles the SEL_KEYPRESS event. This leaves not only the FOX application hung, it leaves the whole desktop hung; completely unresponsive to all mouse movement and clicks! Needless to say, this leaves users beyond angry.

The situation is recoverable - just repeat the key press. But this is a wholly non-obvious recovery step! Application users who encounter the bug often resort to reboots to clear the problem until informed of the work-around.

To see the problem for yourself with FOX's own imageviewer test program and just a very small modification:
  1. Build FOX 1.7.16 - I used: ./configure --enable-debug
  2. cd tests/
  3. Apply the appropriate context diffs attached: patch -p0 < diffs.1.7.19
    • These diffs merely add intercepting SEL_KEYPRESS
    • Note: this isn't "imageviewer" specific, you can do it with "table", "tabbook" and probably others.
  4. make
  5. ./imageviewer
    • Hold "Alt" and press "f" - see the cursor flip around.
    • Now try to do anything with on your desktop with the mouse.
    • Don't panic - to recover, simple hold "Alt" and press "f".
    • Just as interesting, maybe more interesting:
      • press Alt-f, then Alt-e, then Alt-m, and then Alt-v
      • Now press Alt-f to try to recover - the File pop-up drops, but the mouse is still stuck!
      • Now press Alt-v - the View pop-up drops, but the mouse is still stuck!
      • Now press Alt-e - the Edit pop-up drops, but the mouse is still stuck!
      • Finally, press Alt-m - the Manipulation pop-up drops and the mouse is back!
    • For another interesting effect, repeat the steps above, but place the mouse cursor where the pop-up will appear. Note that the newly popped-up menu highlights the item under the mouse cursor. Now move the mouse up and down within the pop-up and note that the item under the mouse cursor highlights just like things are working but ... try pressing the left mouse button to select the highlighted item - no effect! Also, now move the mouse cursor out of the pop-up and then back in. Note that the pop-up now does NOT respond by highlighting the item under the mouse cursor.
    • And, finally, try continuing to hold the Alt key down after pressing "f" - in this case, FOX behaves as expected, tracking the mouse and responding to mouse events - until the Alt key is released; then FOX is hung.
You can do the same with FOX 1.6.36.
-- 
Hal Brand


*** imageviewer.cpp.orig 2009-01-19 18:05:39.000000000 -0800
--- imageviewer.cpp 2009-06-04 15:41:27.000000000 -0700
***************
*** 61,66 ****
--- 61,67 ----
    long onCmdScale(FXObject*,FXSelector,void*);
    long onCmdCrop(FXObject*,FXSelector,void*);
    long onUpdImage(FXObject*,FXSelector,void*);
+   long onKey(FXObject*,FXSelector,void*);
  public:
    enum{
      ID_ABOUT=FXMainWindow::ID_LAST,
***************
*** 220,227 ****
--- 221,234 ----
    FXMAPFUNC(SEL_UPDATE,        ImageWindow::ID_MIRROR_BOTH,ImageWindow::onUpdImage),
    FXMAPFUNC(SEL_UPDATE,        ImageWindow::ID_SCALE,      ImageWindow::onUpdImage),
    FXMAPFUNC(SEL_UPDATE,        ImageWindow::ID_CROP,       ImageWindow::onUpdImage),
+   FXMAPFUNC(SEL_KEYPRESS, 0, ImageWindow::onKey)
    };
 
+ long ImageWindow::onKey(FXObject*,FXSelector,void*)
+ {
+   return 0;
+ }
+
 
  // Object implementation
  FXIMPLEMENT(ImageWindow,FXMainWindow,ImageWindowMap,ARRAYNUMBER(ImageWindowMap))

*** imageviewer.cpp.~1~ 2009-03-12 22:45:10.000000000 -0700
--- imageviewer.cpp 2009-06-04 15:33:15.000000000 -0700
***************
*** 74,79 ****
--- 74,80 ----
    long onCmdScale(FXObject*,FXSelector,void*);
    long onCmdCrop(FXObject*,FXSelector,void*);
    long onUpdImage(FXObject*,FXSelector,void*);
+   long onKey(FXObject*,FXSelector,void*);
  public:
    enum{
      ID_ABOUT=FXMainWindow::ID_LAST,
***************
*** 238,245 ****
--- 239,252 ----
    FXMAPFUNC(SEL_UPDATE,        ImageWindow::ID_MIRROR_BOTH,ImageWindow::onUpdImage),
    FXMAPFUNC(SEL_UPDATE,        ImageWindow::ID_SCALE,      ImageWindow::onUpdImage),
    FXMAPFUNC(SEL_UPDATE,        ImageWindow::ID_CROP,       ImageWindow::onUpdImage),
+   FXMAPFUNC(SEL_KEYPRESS, 0, ImageWindow::onKey)
    };
 
+ long ImageWindow::onKey(FXObject*,FXSelector,void*)
+ {
+   return 0;
+ }
+
 
  // Object implementation
  FXIMPLEMENT(ImageWindow,FXMainWindow,ImageWindowMap,ARRAYNUMBER(ImageWindowMap))

------------------------------------------------------------------------------
OpenSolaris 2009.06 is a cutting edge operating system for enterprises
looking to deploy the next generation of Solaris that includes the latest
innovations from Sun and the OpenSource community. Download a copy and
enjoy capabilities such as Networking, Storage and Virtualization.
Go to: http://p.sf.net/sfu/opensolaris-get
_______________________________________________
Foxgui-users mailing list
Foxgui-users@...
https://lists.sourceforge.net/lists/listinfo/foxgui-users

Parent Message unknown Re: FOX 1.6.36 and 1.7.19 Linux/X11 user-hostile bug

by Yves Colin :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Hal,

I can't really help you (I'm not a fox guru... ;-)) but could it be that these bugs are similar to the one reported here?

 http://www.nabble.com/FOX-based-app-can-block-entire-Xorg-td11315244.html

I couldn't try your method, I've currently no access to my linux machine.

One collegue has already had such a freeze problem (or more probably the one you described in your e-mail of today), so it really happens with "real-life" programs.

best regards,

   Yves


> Date: 05/06/09 at 01h55
> From: "Hal Brand" <brand1@...>
> To: foxgui-users@...
> Object: [Foxgui-users] FOX 1.6.36 and 1.7.19 Linux/X11 user-hostile bug
>
> There is a nasty bug in FOX (1.6.36 and 1.7.16 and as best I can tell
> the whole 1.6.x. and 1.7.x series and maybe before) where, after a key
> press of a key that is mapped to an accelerator, FOX "grabs" the XServer
> and then ignores all mouse clicks and mouse motion if the window handles
> the SEL_KEYPRESS event. This leaves not only the FOX application hung,
> it leaves the whole desktop hung; completely unresponsive to all mouse
> movement and clicks! Needless to say, this leaves users beyond angry.
>
> The situation is recoverable - just repeat the key press. But this is a
> wholly non-obvious recovery step! Application users who encounter the
> bug often resort to reboots to clear the problem until informed of the
> work-around.
>
> [...]


____________________________________________________

Prenez la pause détente avec video.voila.fr http://video.voila.fr 



------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited
royalty-free distribution of the report engine for externally facing
server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
Foxgui-users mailing list
Foxgui-users@...
https://lists.sourceforge.net/lists/listinfo/foxgui-users