• Drag n Drop... was working and not now... why

    From Sherlock@21:1/5 to All on Fri Aug 13 17:17:04 2021
    VO'ers.

    Simple code... why does DROP() not get called. I drag a file from Explorer, see the ICON with the [ + ] for drag n drop... but drop does not execute.
    Have other code that used to work and wonder why now. Yet my Browser drag and drop works. My original code was TEXTcontrol on Dialog window. Tried the STYLE.. tried lots of things. aargh..

    Help... has to be something simple

    Phil

    CLASS MainWindow INHERIT DATAWINDOW

    PROTECT oCCEndWindow AS PUSHBUTTON
    PROTECT oDCFixedText1 AS FIXEDTEXT
    //{{%UC%}} USER CODE STARTS HERE (do NOT remove this line)

    METHOD Drop(oDragEvent) CLASS MainWindow
    ? "METHOD Drop"
    SUPER:Drop(oDragEvent)

    ? oDragEvent:FileCount
    ? oDragEvent:FileName(1)

    RETURN SELF

    METHOD Init(oWindow,iCtlID,oServer,uExtra) CLASS MainWindow

    SELF:PreInit(oWindow,iCtlID,oServer,uExtra)

    SUPER:Init(oWindow,ResourceID{"MainWindow",_GetInst()},iCtlID)

    oCCEndWindow := PushButton{SELF,ResourceID{MAINWINDOW_ENDWINDOW,_GetInst()}} oCCEndWindow:HyperLabel := HyperLabel{#EndWindow,"Close",NULL_STRING,NULL_STRING}

    oDCFixedText1 := FixedText{SELF,ResourceID{MAINWINDOW_FIXEDTEXT1,_GetInst()}} oDCFixedText1:HyperLabel := HyperLabel{#FixedText1,"TODO: Add server, controls "+_CHR(38)+_CHR(38)+" event handlers",NULL_STRING,NULL_STRING}

    SELF:Caption := "DataWindow Caption"
    SELF:HyperLabel := HyperLabel{#MainWindow,"DataWindow Caption",NULL_STRING,NULL_STRING}
    SELF:QuitOnClose := TRUE

    IF !IsNil(oServer)
    SELF:Use(oServer)
    ENDIF

    SELF:PostInit(oWindow,iCtlID,oServer,uExtra)

    RETURN SELF

    METHOD PostInit(oWindow,iCtlID,oServer,uExtra) CLASS MainWindow
    SELF:EnableDragDropClient(TRUE)
    //
    // SELF:oDCFixedText1:SetStyle(WS_EX_ACCEPTFILES , TRUE)
    // SELF:SetStyle(WS_EX_ACCEPTFILES , TRUE)
    //
    RETURN SELF

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Jamal@21:1/5 to Sherlock on Sat Aug 14 00:40:17 2021
    If you run the application from the IDE, the drag/drop does not work!
    You need to generate the EXE then run it. It works for me :)

    Jamal

    On 8/13/2021 8:17 PM, Sherlock wrote:
    VO'ers.

    Simple code... why does DROP() not get called. I drag a file from Explorer, see the ICON with the [ + ] for drag n drop... but drop does not execute.
    Have other code that used to work and wonder why now. Yet my Browser drag and drop works. My original code was TEXTcontrol on Dialog window. Tried the STYLE.. tried lots of things. aargh..

    Help... has to be something simple

    Phil

    CLASS MainWindow INHERIT DATAWINDOW

    PROTECT oCCEndWindow AS PUSHBUTTON
    PROTECT oDCFixedText1 AS FIXEDTEXT
    //{{%UC%}} USER CODE STARTS HERE (do NOT remove this line)

    METHOD Drop(oDragEvent) CLASS MainWindow
    ? "METHOD Drop"
    SUPER:Drop(oDragEvent)

    ? oDragEvent:FileCount
    ? oDragEvent:FileName(1)

    RETURN SELF

    METHOD Init(oWindow,iCtlID,oServer,uExtra) CLASS MainWindow

    SELF:PreInit(oWindow,iCtlID,oServer,uExtra)

    SUPER:Init(oWindow,ResourceID{"MainWindow",_GetInst()},iCtlID)

    oCCEndWindow := PushButton{SELF,ResourceID{MAINWINDOW_ENDWINDOW,_GetInst()}} oCCEndWindow:HyperLabel := HyperLabel{#EndWindow,"Close",NULL_STRING,NULL_STRING}

    oDCFixedText1 := FixedText{SELF,ResourceID{MAINWINDOW_FIXEDTEXT1,_GetInst()}} oDCFixedText1:HyperLabel := HyperLabel{#FixedText1,"TODO: Add server, controls "+_CHR(38)+_CHR(38)+" event handlers",NULL_STRING,NULL_STRING}

    SELF:Caption := "DataWindow Caption"
    SELF:HyperLabel := HyperLabel{#MainWindow,"DataWindow Caption",NULL_STRING,NULL_STRING}
    SELF:QuitOnClose := TRUE

    IF !IsNil(oServer)
    SELF:Use(oServer)
    ENDIF

    SELF:PostInit(oWindow,iCtlID,oServer,uExtra)

    RETURN SELF

    METHOD PostInit(oWindow,iCtlID,oServer,uExtra) CLASS MainWindow
    SELF:EnableDragDropClient(TRUE)
    //
    // SELF:oDCFixedText1:SetStyle(WS_EX_ACCEPTFILES , TRUE)
    // SELF:SetStyle(WS_EX_ACCEPTFILES , TRUE)
    //
    RETURN SELF


    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Phil McGuinness@21:1/5 to Jamal on Sat Aug 14 04:02:34 2021
    Jamal

    Was not aware of this and answer also in XSHARP group.
    So my code that did not work, did actually work but not in IDE.
    Wasted few hours there.. but at least I know.

    Irony is the Drag n Drop to bBrowser does work in IDE.

    Phil

    On Saturday, August 14, 2021 at 2:40:19 PM UTC+10, Jamal wrote:
    If you run the application from the IDE, the drag/drop does not work!
    You need to generate the EXE then run it. It works for me :)

    Jamal
    On 8/13/2021 8:17 PM, Sherlock wrote:
    F:PreInit(oWindow,iCtlID,oServer,uExtra)


    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)