Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Expandable File Folder Contents opening in TbWebBrowser
#1
I can get the folder contents to show up in the Toolbar browser appropriately but when you click on an item, it shows up just as if it were run



Code:
Copy      Help
/hook ToolbarExProc_TWWB /siz 500 300 /set 2
www.quickmacros.com :OpenInTbWebBrowser "http://www.quickmacros.com" * web.ico
Menu3 :mac "Menu3"
Book1.xls :OpenInTbWebBrowser "$personal$\Book1.xls" * $personal$\Book1.xls

Menu 3:
Code:
Copy      Help
/noedit /expandfolders 0x1 0

My Pictures "$my pictures$" "Toolbar5"




I can move it by window trigger but not into the webbrowser itself.










Any ideas?

Also how to add (up a level) to toolbar browser controls?
Maybe get filepath and remove back to \ then redisplay?


Thanks so much!

Stuart


#2
I would like the documents in a folder referenced in a menu on a ToolbarBrowser to open WITHIN the Toolbar Browser Window.

For example, say I have a Toolbar with Webbrowser called ReferenceDocs. One of the toolbar listings is a Menu Called BrainRefMenu.

One of the items in BrainRefs is actually just a folder reference BrainRefsFolder. The menu is set to allow expandable folders in its properties dialog:

Thus the result is like this:

Toolbar with WEbbrowser called ReferenceDocs:

Code:
Copy      Help
/hook ToolbarExProc_TWWB /siz 500 300 /set 2
Reference Docs: : *$common documents$\ReferenceDocs.ico
Brain Refs :mac "BrainRefsMenu"

BrainRefsMenu looks like this:

Code:
Copy      Help
Additional NeuroRefs "$common documents$\BrainRefsFolder" "ReferenceDocs"

When I click on any of the items in the expanding folder menu, they open up in a regular desktop window rather than within the Toolbar Browser.

Any ideas?

Thanks. I hope I explained it better that time!

Thanks again,
Stuart
#3
Function TbExpFolderMenuOpenInWebBrowser
Code:
Copy      Help
;/
function $menuname [$tbname]

;Shows a menu and opens the selected file in web browser on a QM toolbar.
;The menu must have these properties (checked in Properties): 'don't run ...', 'expand file folders'.
;Example of adding web browser to a toolbar is in c:\program files\quick macros 2\installed files\samples2.qml.


;menuname - menu name.
;tbname - toolbar name. Can be omitted when this function is called from the toolbar.


;EXAMPLE toolbar
;;/hook ToolbarExProc_TWWB /siz 500 300 /set 2
;Favorites :TbExpFolderMenuOpenInWebBrowser "menu favorites"


;EXAMPLE menu ("menu favorites")
;;/dontrun /expandfolders
;fav "$favorites$"



int h; str s
;get toolbar hwnd
if(len(tbname)) s=tbname; h=win(s.ucase "QM_toolbar")
else h=val(_command)
if(!h) ret
;show the menu and wait
if(!mac(menuname)) ret
;get selected path
qm.GetLastSelectedMenuItem 0 &s 0
;open in toolbar web browser
WebInQmActiveX s 0 h

Function WebInQmActiveX
Code:
Copy      Help
;/
function# $url [flags] [hwnd] [$url2] [str&geturl2] [&gethwnd] ;;flags: 1 wait, 2 in existing window, 4 in new window, 8 in new IE, 12 in new IE7 tab, 16 url2 exact, 32 get IES hwnd, 64 don't activate, hiword max wait time

;Opens url in a web browser control that is in a QM dialog or other QM window.
;The same as the intrinsic web function, but does not fail if the control currently is not displaying a web page (it may be empty or display a document of other type).


;hwnd - handle of the ActiveX control host control or parent window.
;Other arguments - the same as with web.


;Returns 1 if successful, 0 on error.
;Unlike web, does not return IWebBrowser2 interface pointer. If you need it, use _getcontrol.



;g1
int retry
web url 0 hwnd url2 geturl2 gethwnd
err ;;probably could not connect because is not displaying a web page. Open blank page and retry.
,if(retry) ret
,retry=1
,if(!childtest(hwnd "" "ActiveX")) hwnd=child("" "ActiveX" hwnd); if(!hwnd) ret
,SHDocVw.WebBrowser b._getcontrol(hwnd)
,b.Navigate("about:blank")
,rep() if(b.Busy) wait 0.01; else goto g1
ret 1

---

Up one level button:
Code:
Copy      Help
Up :SHDocVw.WebBrowser b._getcontrol(child("" "ActiveX" val(_command))); str s=b.LocationURL; if(s.begi("file:///")) s.get(s 8); s.findreplace("/" "\"); s.getpath; out s; b.Navigate(s)
#4
That was a tour de force of coding. I can't wait to implement and will let you know how it works.

Thanks again,
Stuart
#5
The two function for the toolbars.
Couldn't get the up button to work but don't really need it now that the expanding folders work!!!
Maybe for future though!

Thanks,
Stuart


Forum Jump:


Users browsing this thread: 1 Guest(s)