2012-04-04 78 views
2

在我的進度應用程序中使用瀏覽器時,滾動條無法正常工作。它會表明我只能向下滾動一點,然後繼續前進。這是一個進展中的錯誤還是有什麼我可以做的,以解決這個問題?使用進度10.2b如何讓滾動條正常工作

/* Connected Databases 
     sports2000  PROGRESS 
*/ 
&Scoped-define WINDOW-NAME wWin 
{adecomm/appserv.i} 
CREATE WIDGET-POOL. 
{src/adm2/widgetprto.i} 
&Scoped-define PROCEDURE-TYPE SmartWindow 
&Scoped-define DB-AWARE no 
&Scoped-define ADM-CONTAINER WINDOW 
&Scoped-define ADM-SUPPORTED-LINKS Data-Target,Data-Source,Page-Target,Update-Source,Update-Target,Filter-target,Filter-Source 
&Scoped-define FRAME-NAME fMain 
&Scoped-define BROWSE-NAME BROWSE-2 
&Scoped-define INTERNAL-TABLES Order 
&Scoped-define FIELDS-IN-QUERY-BROWSE-2 Order.PO Order.OrderDate ~ 
Order.Ordernum 
&Scoped-define ENABLED-FIELDS-IN-QUERY-BROWSE-2 Order.PO Order.OrderDate ~ 
Order.Ordernum 
&Scoped-define ENABLED-TABLES-IN-QUERY-BROWSE-2 Order 
&Scoped-define FIRST-ENABLED-TABLE-IN-QUERY-BROWSE-2 Order 
&Scoped-define QUERY-STRING-BROWSE-2 FOR EACH Order NO-LOCK INDEXED-REPOSITION 
&Scoped-define OPEN-QUERY-BROWSE-2 OPEN QUERY BROWSE-2 FOR EACH Order NO-LOCK INDEXED-REPOSITION. 
&Scoped-define TABLES-IN-QUERY-BROWSE-2 Order 
&Scoped-define FIRST-TABLE-IN-QUERY-BROWSE-2 Order 
&Scoped-define OPEN-BROWSERS-IN-QUERY-fMain ~ 
~{&OPEN-QUERY-BROWSE-2} 
&Scoped-Define ENABLED-OBJECTS BROWSE-2 
DEFINE VAR wWin AS WIDGET-HANDLE NO-UNDO. 

DEFINE QUERY BROWSE-2 FOR 
    Order SCROLLING. 
DEFINE BROWSE BROWSE-2 
    QUERY BROWSE-2 NO-LOCK DISPLAY 
    Order.PO FORMAT "x(20)":U 
    Order.OrderDate FORMAT "99/99/99":U 
    Order.Ordernum FORMAT "zzzzzzzzz9":U 
    ENABLE 
    Order.PO 
    Order.OrderDate 
    Order.Ordernum 
WITH NO-ROW-MARKERS SEPARATORS SIZE 59 BY 8.1 FIT-LAST-COLUMN. 
/* ************************ Frame Definitions *********************** */ 
DEFINE FRAME fMain 
BROWSE-2 AT ROW 4.81 COL 13 WIDGET-ID 200 
WITH 1 DOWN NO-BOX KEEP-TAB-ORDER OVERLAY 
    SIDE-LABELS NO-UNDERLINE THREE-D 
    AT COL 1 ROW 1 
    SIZE 80 BY 17 WIDGET-ID 100. 

IF SESSION:DISPLAY-TYPE = "GUI":U THEN 
CREATE WINDOW wWin ASSIGN 
    HIDDEN    = YES 
    TITLE    = "<insert SmartWindow title>" 
    HEIGHT    = 17 
    WIDTH    = 80 
    MAX-HEIGHT   = 28.81 
    MAX-WIDTH   = 146.2 
    VIRTUAL-HEIGHT  = 28.81 
    VIRTUAL-WIDTH  = 146.2 
    RESIZE    = no 
    SCROLL-BARS  = no 
    STATUS-AREA  = no 
    BGCOLOR   = ? 
    FGCOLOR   = ? 
    THREE-D   = yes 
    MESSAGE-AREA  = no 
    SENSITIVE   = yes. 
ELSE {&WINDOW-NAME} = CURRENT-WINDOW. 

{src/adm2/containr.i} 
IF SESSION:DISPLAY-TYPE = "GUI":U AND VALID-HANDLE(wWin) 
THEN wWin:HIDDEN = yes. 
&Scoped-define SELF-NAME wWin 
ON END-ERROR OF wWin /* <insert SmartWindow title> */ 
OR ENDKEY OF {&WINDOW-NAME} ANYWHERE DO: 
/* This case occurs when the user presses the "Esc" key. 
In a persistently run window, just ignore this. If we did not, the 
application would exit. */ 
IF THIS-PROCEDURE:PERSISTENT THEN RETURN NO-APPLY. 
END. 

ON WINDOW-CLOSE OF wWin /* <insert SmartWindow title> */ 
DO: 
    /* This ADM code must be left here in order for the SmartWindow 
    and its descendents to terminate properly on exit. */ 
    APPLY "CLOSE":U TO THIS-PROCEDURE. 
    RETURN NO-APPLY. 
END. 

&Scoped-define BROWSE-NAME BROWSE-2 
&UNDEFINE SELF-NAME 

/* *************************** Main Block *************************** */ 

/* Include custom Main Block code for SmartWindows. */ 
{src/adm2/windowmn.i} 

/* ********************** Internal Procedures *********************** */ 

PROCEDURE adm-create-objects : 

END PROCEDURE. 

PROCEDURE disable_UI : 
    /* Delete the WINDOW we created */ 
    IF SESSION:DISPLAY-TYPE = "GUI":U AND VALID-HANDLE(wWin) 
    THEN DELETE WIDGET wWin. 
    IF THIS-PROCEDURE:PERSISTENT THEN DELETE PROCEDURE THIS-PROCEDURE. 
END PROCEDURE. 


PROCEDURE enable_UI : 
    ENABLE BROWSE-2 
     WITH FRAME fMain IN WINDOW wWin. 
    {&OPEN-BROWSERS-IN-QUERY-fMain} 
    VIEW wWin. 
END PROCEDURE. 


PROCEDURE exitObject : 

    APPLY "CLOSE":U TO THIS-PROCEDURE. 
    RETURN. 

END PROCEDURE. 

當我使用這樣的瀏覽器,我拉動滾動條下到谷底,然後單擊滾動條上的向下箭頭,還有行(即使滾動條在的底部屏幕)。

+0

也許你可以展示一些示例代碼? – 2012-04-04 20:17:34

+0

謝謝,我添加了一些代碼,我的問題。 – Bill 2012-04-05 13:30:44

+0

你的代碼不能編譯。至少你的「瀏覽-4」查詢丟失。如果你提供一些適用於sports或sports2000數據庫的東西,那也是最好的。 – 2012-04-05 13:38:59

回答

3

我重寫了您的示例代碼以使用「sports2000」數據庫,我可以看到發生了什麼。

define query browse-4 for customer. 

DEFINE BROWSE BROWSE-4 
QUERY BROWSE-4 NO-LOCK DISPLAY 
    custNum name 
/* ENABLE name */ 
WITH NO-ROW-MARKERS SEPARATORS SIZE 32 BY 6.46 FIT-LAST-COLUMN. 
. 

open query browse-4 preselect each customer no-lock. 

enable browse-4. 

wait-for window-close of current-window. 

關鍵的變化是在OPEN QUERY中使用PRESELECT。否則,只返回部分結果集。這是一個已知的功能。

要小心 - 如果您的查詢涉及數千條記錄PRESELECT不會表現得很好。當然,在用戶界面中呈現很多記錄可能是一個不好的主意。