Page 3 of 6

Posted: Sun Nov 13, 2005 3:50 pm
by Nik
Does anyone in this thread know an answer for viewtopic.php?t=17700

Sorry for double posting but I thnik it is important enough for this :oops:

Posted: Sun Jan 15, 2006 2:11 am
by garretthylltun
I'm going to assume that this is MS Windows only since it's using DCOM,
right?

-Garrett

Posted: Sun Jan 15, 2006 2:16 am
by freak
yes.

Posted: Sun Feb 12, 2006 4:38 am
by lexvictory
is there a way to make the webgadget scroll?

Posted: Sun Feb 12, 2006 9:46 am
by freak

Posted: Wed Feb 15, 2006 10:31 am
by lexvictory
yeah, but i dont understand german... can u translate it into english?

Posted: Thu Feb 16, 2006 10:07 pm
by Flype
Can these interfaces (IHTML_xxxx) be updated natively in PB4.0 ?
As we can see in the WebGadgetExtras.pb there's a lot of thing to update...
Not urgent but i would be nice. :wink:

Posted: Thu Mar 16, 2006 1:42 pm
by real
Is there anybody out there who converted the WebGadgetExtras.pb to PB 4???

I used it under v3.94 and wanted to take advantage of strings longer than 64KB in v4.0, but I can't compile the WebGadgetExtras.pb anymore. :cry:

Posted: Mon Mar 20, 2006 7:08 pm
by oryaaaaa
How can get all source code (include HEAD)

Code: Select all

 IHTMLDocument2 *HTMLDocument = NULL;
  WCHAR           wszShortcutFile[512];
  LPDISPATCH lpdisp;

  lpdisp = m_web0.GetDocument();
  HTMLDocument = (IHTMLDocument2 *)lpdisp;
  HRESULT hr4 = HTMLDocument->QueryInterface(IID_IPersistFile,(void **)&PersistFile);
  MultiByteToWideChar(CP_ACP, 0, "C:\\test.html", -1,
                       wszShortcutFile, 512);
  PersistFile->Save(wszShortcutFile,TRUE);
All Soucecode to File save with C
How do it become it if it translates into PureBasic?

Posted: Tue Mar 21, 2006 5:14 am
by oryaaaaa

Code: Select all

DataSection
IID_IPersistFile:
  ; 0000010b-0000-0000-C000-000000000046
Data.l $0000010B
Data.w $0000,$0000
Data.b $C0,$00,$00,$00,$00,$00,$00,$46
EndDataSection
  
Procedure WebGadget_Read(Gadget, tempfile.s)
    Shared WebGadget_Document.IHTMLDocument2_FIXED
    result = 0
    
    If GetGadgetText(Gadget) = ""
      SetGadgetText(Gadget, "about:blank")
    EndIf
    memoryurl.s=GetGadgetText(Gadget)
    
    WebGadget_Document = 0
    Browser.IWebBrowser2 = GetWindowLong_(GadgetID(Gadget), #GWL_USERDATA)
    If Browser
      If Browser\get_document(@DocumentDispatch.IDispatch) = #S_OK
        If DocumentDispatch\QueryInterface(?IID_IPersistFile, @PersistFile.IPersistFile) = #S_OK      
          mem.s = Space(1000)
          MultiByteToWideChar_(#CP_ACP, 0, tempfile, -1, mem, 1000)
          hres = PersistFile\SAVE(@mem,#True)
          result = 1
        EndIf
        DocumentDispatch\Release()
      EndIf  
      Browser\Release()
    EndIf
    SetGadgetText(Gadget, memoryurl)
    
  ProcedureReturn result
EndProcedure  

Posted: Thu Apr 06, 2006 7:37 pm
by Dummy
In PB 4 Beta 9 the parameter Link$ of the callbackfunction is always empty. Pls fix.

Posted: Fri Apr 07, 2006 6:54 pm
by uweb
Does anybody know how to handel JavaScript-Links ?

This is my try :

Code: Select all

XIncludeFile "WebGadgetExtras.pb"

#WebGadget = 0

Procedure LinkCallback(Gadget, Link$, Text$, ID$, Class$)

  Debug "Gadget: "+Str(Gadget)

  Debug "Link: "+Link$
  Debug "Text: "+Text$

  Debug ""

  ProcedureReturn 0 ; prevent link from executing
EndProcedure

If OpenWindow(0, 0, 0, 800, 600, #PB_Window_SystemMenu|#PB_Window_ScreenCentered, "WebGadget example")
  If CreateGadgetList(WindowID())
   
    WebGadget(#WebGadget, 0, 0, 800, 600, "")   
           
    If WebGadget_Open(#WebGadget, 0)
   
      WebGadget_Write("<html>")
      WebGadget_Write("<head>")
      WebGadget_Write("<title>Text des Titels</title>")
      WebGadget_Write("<script type='text/javascript'>")
      WebGadget_Write("function Go() {")
      WebGadget_Write("  var Vorname = document.Formular.Vorname.value;")

      WebGadget_Write("  var test1 = '<a href=execute&nbsp;'+Vorname+' id=a123>x123</a>';")
      WebGadget_Write("  var test2 = 'execute '+Vorname;")

      WebGadget_Write("  this.a123.outerHTML = test1;")
      WebGadget_Write("  alert(this.a123.outerHTML);")

;      WebGadget_Write("  this.a123.click();")
;      WebGadget_Write("  window.location.href = test2;")

      WebGadget_Write("}")
      WebGadget_Write("</script>")
      WebGadget_Write("</head>")
      WebGadget_Write("<body>")
      WebGadget_Write("<a href='12' id='a123'>123</a><br>")
      WebGadget_Write("<a href='456'>456</a><br><br>")
      WebGadget_Write("<h1>Das hier k&ouml;nnen Sie absenden!</h1>")
      WebGadget_Write("<form name='Formular' action='javascript:Go()'>")
      WebGadget_Write("<table border='0' cellpadding='5' cellspacing='0' bgcolor='#E0E0E0'>")
      WebGadget_Write(" <tr>")
      WebGadget_Write("  <td align='right'>Vorname:</td>")
      WebGadget_Write("  <td><input name='Vorname' type='text' size='30' maxlength='30'></td>")
      WebGadget_Write(" </tr><tr>")
      WebGadget_Write("  <td align='right'>Zuname:</td>")
      WebGadget_Write("  <td><input name='Zuname' type='text' size='30' maxlength='40'></td>")
      WebGadget_Write(" </tr><tr>")
      WebGadget_Write("  <td align='right' valign='top'>Kommentar:</td>")
      WebGadget_Write("  <td><textarea name='Text' rows='10' cols='50'></textarea></td>")
      WebGadget_Write(" </tr><tr>")
      WebGadget_Write("  <td align='right'>Formular:</td>")
      WebGadget_Write("  <td>")
      WebGadget_Write("   <input type='submit' value=' Absenden '>")
      WebGadget_Write("   <input type='reset' value=' Abbrechen'>")
      WebGadget_Write("  </td>")
      WebGadget_Write(" </tr>")
      WebGadget_Write("</table>")
      WebGadget_Write("</form>")
      WebGadget_Write("</body>")
      WebGadget_Write("</html>")
   
      WebGadget_Close()
    EndIf
   
    WebGadget_CatchLinks(#WebGadget, @LinkCallback())           
   
    Repeat
    Until WaitWindowEvent() = #PB_Event_CloseWindow   
   
  EndIf
EndIf
edit :

The 4. way

Code: Select all

WebGadget_Write("  this.a123.innerHTML = test2;")
do not work also.

What i wont is to interact whith Javascript. A Form is only one Case for this.

Posted: Sat Apr 08, 2006 12:14 am
by freak
See my post on interacting with JavaScript here:
http://www.purebasic.fr/english/viewtop ... 68&start=0

I plan to put all this code together into a library but right now i just do not have the time.

Posted: Sat Apr 08, 2006 8:01 am
by uweb
Great !

My english is not the best, so i am not so often here.
But now i see : I have to change.

I dont know why but many german send there perls only (instead of also) in english.
Well, its there decision.

I am thankful even so !

Posted: Mon Apr 10, 2006 6:02 pm
by zikitrake
real wrote:Is there anybody out there who converted the WebGadgetExtras.pb to PB 4???

I used it under v3.94 and wanted to take advantage of strings longer than 64KB in v4.0, but I can't compile the WebGadgetExtras.pb anymore. :cry:
+1 :D