Wednesday, February 25, 2015

For Each...EndFor GOTCHA!!!!

Working on a new concept for my Fake Tabs need, I decided to create a container class that will act as a page tab.  Then to emulate a pageframe, I control the position of the tab on each instances of the class.  Then pile those up on top of each other.  So if I need say 5 tabs, then that will be 5 of that container class that is piled on top of each other.  Switching tabs is done via switching Zorder().

With this fake tab, I can change colors per tab or use the same color but with different shades.  With the tab width auto-adjusting based on the caption I put into it plus its Font Name and Size, I am happy with the result.

While those can be achieved as well on the native VFP tab via turning Themes=.F. and TabStyle = 1 (Non-justified) properties of a pageframe object, I like to have a uniquely looking tab for my use and not that Windows 98 looking tabs when I need a colored tab; so the extra work on my end to achieve it.

Everything works to my satisfaction until I decided to add a sort of highlighter in the form of a dotted transparent shape to act as an indicator of the active tab.


Tuesday, February 17, 2015

Firefox Inside VFP Form

Nothing new here, I used the same approach in the Chrome one but worked on FireFox itself this time.  This is to see if my suspicion that the reason for WinAPIs' inability to control the titlebar of Chrome is because it really has its own titlebar.

Also, this is based on advise of Bernard Bout to try this on FireFox.  This works on my end since I am using an older version of FF which is 12.  The titlebar is hidden properly.  I have not tried it though on newer version of FF as I don't download any being I prefer Chrome.  So it is up to you guys to test this on those newer version.


Anyway, here are the codes, with the same approach I used on Chrome and some changes on Windows Styles:

Monday, February 16, 2015

Chrome inside VFP Form

Update February 18, 2015:

This is getting interesting.  I suddenly thought maybe Chrome allows parameters to be passed and indeed there are, tons of it.   Here are the switches:

http://peter.sh/experiments/chromium-command-line-switches/

As for forcing Chrome to open on a new window instead of the existing one as a tab, it is --new-window

I also updated the sample below to know whether the operation is successful or not so it won't accidentally open any other active window aside from our target.

Later:

As  for my problem to get rid of Chrome's internal titlebar, the trick came out to be very easy.   All we need to do is move the chrome up from within our form that its own internal titlebar cannot be seen anymore, and thus rendering it likewise immovable.

Check the codes below, adjust lnMove value based on how you set up your Chrome on your end.  Since in mine I show my bookmarks, then my adjustment is 100.  Maybe on the link I gave above on the command switches, there are commands to hide those, but I did not check anymore. :)

======

Sparked by last week's thread inside Foxite Forum about placing an IE Browser inside VFP Form, I thought to myself it would be cool to put Google Chrome inside our form for a change.

Also, this will ensure that most probably a webpage can be displayed properly being Chrome is always up to date with changes introduced now and then, as compared to IE that has been left far behind and is giving developers now some headache to fix it via Registry tweaks.


Googling does not give me any result on how this new sudden thought of mine can be done as I never found any that shows how to achieve this without downloading and working on extension designed to provide automation to google.  But I simply wanted chrome to be inside our VFP form using stock VFP commands and function plus utilizing WinAPIs.

Thursday, February 5, 2015

xBox with Dropdown Grid

Updates 2/10/2015

Added optional sort of tooltip guide containing the internal caption via _withGuide property (default is .T. or shown).  I realized that with the class relying on internal caption, it is sometimes hard to know where you are once the focus is on it (I feel sorry for my users) until they become so familiarize with the module.

I was adjusting our Request module when that realization hit me.  So if you want it shown, set it to .T..  However, please be aware that once you allow the guide to be shown, then the dropdown grid will adjust downwards to give room for it, otherwise it won't be seen.



Updates 2/9/2015