Page 1 of 1

Paste WebGadget doesn't work

Posted: Sat Feb 16, 2008 12:06 am
by Nico
Impossible to copy the text in the WebGadget :x :roll:

Code: Select all

Enumeration 1
  #OLECMDID_OPEN
  #OLECMDID_NEW
  #OLECMDID_SAVE
  #OLECMDID_SAVEAS
  #OLECMDID_SAVECOPYAS
  #OLECMDID_PRINT
  #OLECMDID_PRINTPREVIEW
  #OLECMDID_PAGESETUP
  #OLECMDID_SPELL
  #OLECMDID_PROPERTIES
  #OLECMDID_CUT
  #OLECMDID_COPY
  #OLECMDID_PASTE
  #OLECMDID_PASTESPECIAL
  #OLECMDID_UNDO
  #OLECMDID_REDO
  #OLECMDID_SELECTALL
  #OLECMDID_CLEARSELECTION
  #OLECMDID_ZOOM
  #OLECMDID_GETZOOMRANGE
  #OLECMDID_UPDATECOMMANDS
  #OLECMDID_REFRESH
  #OLECMDID_STOP
  #OLECMDID_HIDETOOLBARS
  #OLECMDID_SETPROGRESSMAX
  #OLECMDID_SETPROGRESSPOS
  #OLECMDID_SETPROGRESSTEXT
  #OLECMDID_SETTITLE
  #OLECMDID_SETDOWNLOADSTATE
  #OLECMDID_STOPDOWNLOAD
EndEnumeration

Enumeration 0
     #OLECMDEXECOPT_DODEFAULT
     #OLECMDEXECOPT_PROMPTUSER
     #OLECMDEXECOPT_DONTPROMPTUSER
     #OLECMDEXECOPT_SHOWHELP
EndEnumeration

#Paste=1002

If OpenWindow(0, 0, 0, 600, 600, "WebGadget", #PB_Window_ScreenCentered|#PB_Window_SystemMenu)

    AddKeyboardShortcut(0,#PB_Shortcut_Control | #PB_Shortcut_V, #Paste)
  
  If CreateGadgetList(WindowID(0))
    WebGadget(0, 20, 20, 560, 560, "http://purebasic.fr/french/login.php")
    WebObject.IWebBrowser2 = GetWindowLong_(GadgetID(0), #GWL_USERDATA)
     
   
  Repeat
    Event =WaitWindowEvent()
    Select Event
      Case #PB_Event_Menu
        Select EventMenu() 
            Case #Paste
            SetClipboardText("PureBasic")
            WebObject\ExecWB(#OLECMDID_PASTE, #OLECMDEXECOPT_DONTPROMPTUSER, 0, 0)
        EndSelect 
    EndSelect 

    Until Event = #PB_Event_CloseWindow
  EndIf
EndIf

Posted: Sat Feb 16, 2008 2:22 am
by rsts
How are you invoking the 'paste' operation?

Posted: Sat Feb 16, 2008 2:43 am
by SFSxOI
the text in the webgadget copy works fine here.

Posted: Sat Feb 16, 2008 10:10 am
by Nico
Click in a aera text in the WebGadget and do CTRL + V, the text isn't paste.

Don't work for me. :?

Posted: Sat Feb 16, 2008 2:06 pm
by SFSxOI
hmmm...works here like this in PB v 4.10; I can ctrl +V paste and 'PureBasic' is pasted....I can also right click and paste..

Image

is this not what its supposed to do? thats the only text type area showing...or am I mis-understanding?

Posted: Sat Feb 16, 2008 3:38 pm
by Nico
It's work for you and not for me, why?

I have also PB 4.10! and Internet Explorer 6

Posted: Sat Feb 16, 2008 4:59 pm
by rsts
It works fine for me too.

Just a thought, are you sure you have a valid format on your clipboard?

cheers

Posted: Sat Feb 16, 2008 5:25 pm
by Nico
MSDN say:
Certain commands (OLECMDID_CUT, OLECMDID_COPY, and OLECMDID_PASTE) are only available if URLACTION_SCRIPT_SAFE_ACTIVEX and URLACTION_SCRIPT_PASTE are set to URLPOLICY_ALLOW.
How to program that!

Posted: Sat Feb 16, 2008 5:43 pm
by rsts
Nico wrote:Click in a aera text in the WebGadget and do CTRL + V, the text isn't paste.

Don't work for me. :?
Are you attempting to paste into the username or password area or into some other area?

cheers

Posted: Sat Feb 16, 2008 5:55 pm
by SFSxOI
maybe something to do with IE6 in some odd way?

maybe clipboard issue of some type?

permissions of some sort?

Dunno, but works fine here. I'm using Vista Ultimate (if it makes a difference).

Posted: Sat Feb 16, 2008 6:26 pm
by Nico
I found, if copy and paste does not work, it is necessary to do:

[in French sorry]
Outils-->Option internet-->Onglet Sécurité-->Personnaliser le niveau-->Autoriser l'accès programmatique du presse-papiers-->cocher autoriser

Thanks for your Help!