Planet FoxPro

April 17, 2014

The Problem Solver

Sandstorm's Blog (Home of ssClasses)

Get a list of Countries and Capitals of the World

Here is a simple snippet to get the countries of the world and its corresponding capitals, again via XMLHttpRequest. And so the result is dependent whether the source site won't change their HTML codes.

Actually, this is just a proposed answer to a member in need inside Foxite as he is looking for a way to get a list of something like this.  I surfed the net a while ago and saw a good site to extract info from and since there is a possibility that  someone out there who is not a member of the forum may need something like this, then here it is:

****************
* Get Countries & Capitals
****************

* For Clearing URL Cache
Declare Integer DeleteUrlCacheEntry In wininet String lpszUrlName

Local o As msxml2.xmlhttp, lcURL
lcURL = [http://www.mapsofworld.com/countries-capitals/]
o = Createobject("msxml2.xmlhttp")

o.Open("GET",m.lcURL,.F.)
o.Send(.Null.)
Do While o.readyState <> 4
      Wait Window Seconds() Nowait
Enddo
Wait Window 'Getting Info, please wait....' Nowait

Create Cursor Countries (Country c(50), Capital c(40))
lcSection = Strextract(o.responseText,'>Capital<','</table>')
For lnloop = 1 To 500
      Try
            Insert Into Countries (Country) Values (Strextract(m.lcSection,'<td>','</td>',m.lnloop))
            Replace Capital With (Strextract(m.lcSection,'<td>','</td>',m.lnloop+1))
            lnloop = lnloop + 1
      Catch
            Exit
      Endtry
Next

* Sort it now, remove empty extractions
Select * From Countries Where !Empty(Country) Order By 1 Into Cursor Countries NOFILTER

Browse Normal

o.abort
DeleteUrlCacheEntry(m.lcURL)

Enjoy!

by Jun Tangunan (noreply@blogger.com) at April 17, 2014 06:25 AM

Alex Feldstein

Sandstorm's Blog (Home of ssClasses)

BizCore Popper

This is something I cannot easily share because its usage is dependent on how I design my ERP app... but hopefully it can give you ideas to do the same on your end.

What is BizCore Popper

Well, originally I plan to call this BizCore Messenger but then there is no originality on that.  And I wanted my apps to sort of look and feel unique.  So I changed the name into Popper (it pops up a message, isn't it?).  So there you go, BizCore Popper.

Brief History 

We actually have a messenger for our LAN here but said messenger do not run under Windows higher than XP.  So it is half used in our office.

My BizCore ERP done in VFP9 runs though on any Windows OS we have so I thought instead of relying onto a 3rd party app, why not create my own?  And then the thought got shelved somewhere in the corner of my mind and remained dormant for a very long time due to a lot other things I do.

However, one time Ony Too shared a new library with a cachy name FoxGrowl inside Foxite which is actually a desktop notification tool.  And my plan on creating a messenger has been reactivated thinking I will turn FoxGrowl into a messenger.  Though the design for FoxGrowl is to notify every one on the LAN and not a specific user, it can be turned into a selective/specific user notification.

But then, I realized I will have to change a lot on said Library to suit my needs that in the end the design will be totally different than the growling notification it is intended to be.  So I abandoned the modification of the library and instead built myself something totally different which is what this ERP is using now.  If you are intrigued on what FoxGrowl is, here is the link showing also the download link:  http://www.foxite.com/archives/0000403119.htm


Making my Popper Unique and appealing

The original plan is to utilize the user's own images, shrunk to smaller sizes via Isometric value of Picture property.  But initial testings have proven those to be unattractive.  Or to retain the real sizes but then it eats real estate.  Plus I wanted this to be looking unique so I decided to look for animated gifs in the web thinking I will let my users choose their own animated avatars later for the poppers.

But finding similarly sized or at least smaller appealing animated gifs proved to be hard.  So I turned to emoticons instead as Avatars.

While surfing for cool emoticons, one character suddenly appeared in the midst of those and that is a minion of Despicable Me movies.

Said minion is looking attractive with that childish innocent grin appeal that it brings smile to my lips.  And so goodbye emoticons, welcome Minions!

Attack of the Minions!

Here is the problem, once I started looking for minions, I was attracted to several looks and expressions that I was not able to help myself but started collecting those, LOL!  In the end, I got 79 characters cleaned and stored on a memo field, with only 1 character of which is not a minion but I like it for our ladies so it was added.

Original design is for ssPopper (yes part of it is a class and so it starts with ss) to randomly pick one of the minions on every pop, like this:



But then I like things to be flexible so in the end I gave also users the ability to choose their own avatar instead of a random one cycling to each characters via the arrow keys.  The last minion character  shown (or their favorite) is retained on next opening until they choose another.


And here it is on Full Screen:


Epilogue: 

BizCore Popper is nothing but just a simple messenger right now.  The purpose is for users of my ERP app to send messages to each other back and forth as long as said ERP app is running.  Like other messengers, a user can send messages to any one of BizCore's online users, or to several users or to all users (Broadcast).

The purpose of this post is to give ideas on a possible look of a messenger.  Maybe some of you will find this attractive enough to try creating one as well or to sort of copy the design and look or feel. Some may think this looks childish but hey, my users love these minions.  I think they love these more than if I put their own pictures on the pop ups as while I gave the ability to initially choose an avatar, by design, I made the next pop ups (via replies) randomly picking a minion.  So it adds a sort of surprise or expectation as to which minion will appear next. :)

"Life is like a box of chocolate.  You'll never know what you're gonna get!" - Forest Gump

Some says VFP is dead.  But in my end, whoever sees newly my ERP app with even those who has developing skills often asked me, "on which PL was it is done?"  And when I say VFP, they can't help themselves but openly admire that VFP is really that awesome.

Cheers!


by Jun Tangunan (noreply@blogger.com) at April 17, 2014 04:53 AM

April 16, 2014

Alex Feldstein

April 15, 2014

Alex Feldstein

April 14, 2014

VisualFoxProWiki

UpcomingEvents

Editor comments: Added LA Fox June 2014 Date
A place to list upcoming Visual FoxPro events like conferences, meetings, user groups, open training sessions...
Closest at the top please, and please remove past events.

April 14, 2014 06:05 PM

Alex Feldstein

Photo of the Day

Got an invite to fly a Nanchang CJ-6 out of Kendall-Tamiami (KTMB). Lots of fun over the Everglades.




We did two barrel rolls. Took lots of photos. Still processing the aerials (nice pics of the Everglades an the islands at the tip of Florida). We even buzzed a boat at close to 100 ft!


The set is at my website.

Awesome!

by Alex Feldstein (noreply@blogger.com) at April 14, 2014 05:00 AM

April 13, 2014

Craig Bailey.net

Three types of people

In the spirit of using completely arbitrary ways to categorise people, I’d like to suggest that there’s 3 types of people.

At the end of Captain America: The Winter Soldier you are one of these:

  1. The person who walks out the instant the credits start rolling
  2. The person who waits for the ‘bonus’ bit that all comic related movies have these days. Once that bit in the middle of the credits has played, you congratulate yourself for waiting and then walk out
  3. The person who is overly cautious and waits right until the very end, and then as the credits finish and the final roman numeral copyright year rolls off the top of the screen you are rewarded with the ‘Bucky’ scene.

 

The post Three types of people appeared first on Craig Bailey.net.

by Craig Bailey at April 13, 2014 05:58 AM

Alex Feldstein

Photo of the Day


1949 Cadillac at the Festival (Pompano) vintage car show in March.

As a follow up to my early video editing I also made a very short video of this car, incorporating some stills:


by Alex Feldstein (noreply@blogger.com) at April 13, 2014 05:00 AM

April 12, 2014

Alex Feldstein

Watch Your Inner Fish

If you missed the first episode of “Your Inner Fish” by Dr. Neil Shubin in PBS, it is now online for you to watch. Don’t miss it!

image

by Alex Feldstein (noreply@blogger.com) at April 12, 2014 06:00 PM

April 11, 2014

Alex Feldstein

April 10, 2014

Beth Massi - Sharing the goodness

Exciting Times for .NET

Last week I had the pleasure of speaking at //build/ which is the premiere developer event of the year for Microsoft. As I mentioned in the rollup yesterday, yours truly spoke in the Office & SharePoint developer track. According to the tweets and feedback afterwards, my session went really well. You can watch it here: Developing Office 365 Cloud Business Apps.

Although the Office team did have presence at //build/, it was definitely dominated by Windows, Azure and .NET. As a long-time .NET developer, it was an amazing and electric vibe! As an employee, it was far better than any morale event I’ve ever been to. It was awesome seeing all the positive reactions to our announcements. There was a lot of love given to us .NET developers, and at the same time cross-platform development permeated the hallways.

The larger team that I work for in Visual Studio is responsible for a ton of Visual Studio tools (as you probably know from my posts here), but our team is also responsible for the core .NET framework, CLR, and Managed Languages (VB, C#, F#) among a lot of other things. Boy! Did .NET and languages make a big splash at //build/.

WP_20140403_002The second day keynote featured the legendary Anders Hejlsberg where he published “Roslyn” (the .NET Compiler Platform) onto CodePlex live and announced the open sourcing of the project. The applause was deafening in the overflow room I was standing in. (Yes there were many overflowed overflow rooms.)

This highlights the change of attitude across all our teams to really embrace open source and cross-platform development in the “New Microsoft”.

As a Visual Studio user, you can install a preview into VS2013 that will switch you to the Roslyn compiler to get the new language features as well as IDE enhancements that Dustin and Mads showed off at their (overflowed) session. Also check out these related Channel 9 interviews.

I also encourage you to read Matt’s post about how you can get started and really understand what you can do with Roslyn: Taking a tour of Roslyn.

imageThat’s not all for .NET by a long shot.

Did you know that there are 1.8 billion active installs of .NET and 6 million .NET developers in the world? Yep, we’re committed to it.

Soma posted about The .NET Foundation and .NET Platform Innovation that we are building upon. The .NET foundation is the steward of a growing collection of open source technologies for .NET, maintained by MS Open Tech, who are our partners in this endeavor. Besides the Roslyn project, .NET foundation includes many active .NET projects that we will be contributing to with the community. This includes a big partnership with Xamarin for building cross-platform native mobile apps.

Another big announcement for .NET was the .NET Native Preview, which offers you the performance of C++ with the productivity of C#. The preview release enables you to build Windows Store apps which start up to 60% faster and have a much smaller memory footprint. We will continue to expand native compilation for the range of .NET applications in the future. Read all about it on the .NET Team blog: Announcing .NET Native Preview

Also released as part of the next generation of .NET was another preview of RyuJIT (CTP3), an improved JIT compiler, now with SIMD support. If that sentence doesn’t make sense, read Immo’s post where he explains it all extremely well, even to us mortals: The JIT finally proposed. JIT and SIMD are getting married.

Jay & Habib both had some good sessions and Channel9 interviews with other members of the team on our .NET innovations that you should also check out.

But wait there’s more! So… much… more…

Here’s some more awesome things for .NET developers to bite into. 

Of course there is so much more to explore. Check out Channel 9 for all the //build/ content.

You asked for it, you got it. .NET Native, Open, and Cross-platform.

Of course there are a lot of other amazing parts of the Visual Studio team – and we have a ton of amazing partners doing amazing things all across the company. I am very proud to work for this amazing place. (Yes I know I said amazing four times.) Check out the Visual Studio team blog, & Brian Harry’s blog for more Visual Studio goodies.

I have to be honest, the weeks leading up to //build/ had many of us running around like chickens with our heads cut off trying to organize all of the release timings with the sessions and keynotes, marketing and PR, web site & blogs publishing, etc. We had so many fabulous releases though and it was amazing to see it all come together. It was definitely worth all the hard work and I couldn’t be more proud of what the team has accomplished.

It’s an absolutely exciting time to be a .NET developer.

Enjoy!

by Beth Massi - Microsoft at April 10, 2014 10:40 PM

VisualFoxProWiki

FoxPro2ToVFPConsultants

Editor comments: forgot to include contact
I receive periodic calls for developers/consultants who are capable of migrating FoxPro 2.x projects to Visual FoxPro. If this is a service you can/will provide, please add your name and contact info to the list.

April 10, 2014 02:00 PM

Alex Feldstein

April 09, 2014

Alex Feldstein

The Wrong Way to Pay for Financial Advice

Morgan Housel, a wonderful writer and one of my favorites at The Motley Fool has a great column this week titled  "The Wrong Way to Pay for Financial Advice".

I am always interested in investing issues and am fully invested in the market, to improve my chances of a comfortable retirement. Most people I talk to about investments tell me they delegate that to a professional advisor and they usually pay 1% a year for this "service".

I, on the other hand, follow the Motley Fools, which have a subscription service for a fixed price a year. I am free to take their advice, or not. I then do my own investments, based on what I learn, They do the heavy lifting (reading the financial statements and doing the professional analysis), which most people do not have the time for and are generally not qualified to do (myself included).

Morgan correctly criticizes the current - and widespread - model of charging a percentage. That is ridiculous! It does not matter the size of your investment portfolio. It does not matter if they perform well, or poorly. They get paid the same. Does it cost them 2 times more to manage a $500,000 portfolio than a $1,000,000 one? Of course not. It's a racket and most people do not even realize they have fallen for it year after year.

I asked a friend not long ago about this (he is paying 1%), and asked how did he do last year. "Very well", he answered, close to 30% up, and he was all smiles!

Wait! He is telling me that in a year when the market went up by over 32% (S&P 500), his expensive professional " expert" did not even beat the market? He could have just invested all his client's money in a passive index fund and gone to the beach the rest of the year and do better than that!

I actively manage my own account, with the excellent advice of the Fool and made over 36% in 2013. That means I beat the market by 4%. For a fixed price for the advice. That's what I am talking about.

Here's Morgan Housel's excellent article again. Go read it.
http://www.fool.com/investing/general/2014/04/07/adv.aspx

by Alex Feldstein (noreply@blogger.com) at April 09, 2014 08:39 PM

Bought a GoPro!

I recently bought a GoPro camera to start playing with video.

I am primarily a still photographer, but thought it would be fun to film my flight lessons.

In order to learn how to film and edit video, I posted a couple of very short videos in my channel. This way I learn editing, adding sound tracks, overlayed text, and simple effects like transitions. I also added some of my still photography to it.

What do you think?


(short video of a Grummand Mallard at Sun-N-Fun in Lakeland, Florida)

by Alex Feldstein (noreply@blogger.com) at April 09, 2014 12:28 PM

April 08, 2014

Sandstorm's Blog (Home of ssClasses)

Working on Invisible Objects

I remembered this is another trick I use on my end (mostly in connection with ssToExcel and ssExcelPivot classes) and some may not know that this can be done so here it is.

When I designed both classes, I am still working back then with ssButton series.  While I still sometimes use those, now I prefer mostly ButtonX of ssUltimate library which I started working on after I shared ssClasses in CodePlex; the purpose is to give my subscribers an edge for the monetary contributions they gave me (later I will start showing here the new classes on that new library)

Having said, ButtonX is cleaner, and has improved codes and looks than its ancestors ssButton series.  As I keep on designing buttons, switches and other things over the years on Photoshop, I believe I was able to slowly refine the new looks for those classes.  And so using ssToExcel or ssExcelPivot classes now on my forms will somewhat break the look of my recent GUI designs.



So what I do in case I need ssToExcel or ssExcelPivot class' (from ssClasses) powers on my form is to turn its Visible property to .F., drop and use ButtonX (from ssUltimate) and on its click event put something like this:

thisform.ssexcelpivot1.Click 

That is because the real codes for exporting data into excel still resides in those invisible classes.  And that is how I was able to harness the powers of those classes without breaking the looks of my recent GUI designs.


You can do the same, say you are using the native commandbutton or commandgroup objects, or classes by other contributors like Bernard Bout, to combine those classes or native objects and tap onto my classes, the invisible way.

And of course, as the title of this blog says "Working on Invisible Objects", this trick can be done not only on my classes but on almost anything.  Invisible objects still functions, you should know by now.

Hope this gives you another idea.


by Jun Tangunan (noreply@blogger.com) at April 08, 2014 10:54 PM

Alex Feldstein

Photo of the Day


Fat Albert @ Sun-N-Fun
I just returned from a few days at Sun-N-Fun, the second biggest airshow in the USA. It is held every year in Lakeland, Florida
I have a lot of pictures to process, so you will be seeing a few new ones here and there, and as always, they are all in my website.

by Alex Feldstein (noreply@blogger.com) at April 08, 2014 11:35 AM

Articles

Game Review: God of Light

God of LightLuckily I came across this title at a very early stage. If I remember correctly, I took notice of God of Light on Twitter right on the weekend it has been published on the Play Store.

"Sit back and become immersed into the world of God of Light, the game that rethinks the physics puzzle genre with its unique environment exploration gameplay, amazing graphics and exclusive soundtrack created by electronic music icon UNKLE.

Join cute game mascot, Shiny, on his way to saving the universe from the impending darkness. Play through a variety of exciting game worlds and dozens of levels with mind-blowing puzzles. Your goal is to explore game levels, seek for game objects that reflect, split, combine, paint, bend and teleport rays of light energy to activate the Sources of Life and bring light back to the universe."

Mastering the various reflection items in God of Light is very easy to learn and new elements are introduced during the game.

Amazing puzzle game

Here's the initial review I posted on the Play Store:

"Great change in puzzles

Fantastic and refreshing concept of puzzle solving. The effects and the music match very well, putting the player in the right mood to game. Get enlightened and grow your skills until you are a true God of Light."

And it remains true, even after completing the first realm completely. Similar to Quell it took me only a couple of hours during the evening to complete all levels in the available three realms, unfortunately. God of Light currently consists of 75 levels, well it's 25 in each realm to be precise, and the challenges are increasing. Compared to the iOS version from the AppStore, God of Light is available for free on Android - at least the first realm (25 levels). Unlocking the other two remaining realms is done through an in-app purchase.

The visual appearance, the sound effects and the background music provided by UNKLE makes God of Light a superb package for any puzzle gamer. Whether it is simply reflecting light over multiple mirrors, or later on bending the rays of light with black holes, or using prisms to either split, enforce, or colourise your beam, God of Light is great fun and offers a good amount of joy. Check out the following screenshots for some impressions.

God of Light - Title screen
God of Light: Astonishing graphics and visual appeal throughout the game

God of Light - Introduction to the game during the first levels. New light items are introduced at each stage during the game play
God of Light - Introduction to the game during the first levels. New light items are introduced at each stage during the game play

God of Light - Increasing complexity and puzzle fun
God of Light: Increasing complexity and puzzle fun

Hopefully, Playmous is going to provide more astonishing looking realms and interesting gimmicks in future versions.

Play Store: God of Light

Also, check out the latest game updates on the official web site of Playmous

by Jochen Kirstaetter (jochen@kirstaetter.name) at April 08, 2014 10:16 AM

Sandstorm's Blog (Home of ssClasses)

Extending ssToExcel & ssExcelPivot classes

For those who are familiar with ssToExcel, ssToExcel2, and ssExcelPivot classes, then they already know that it can easily export records from a table or cursor into Excel with added formats or create a pivot report by setting just a few properties in no time at all.  For those who are wondering what these classes are, then here are my original posts on this:

ssToExcel2:
http://sandstorm36.blogspot.com.au/2012/02/sstoexcel2.html

ssExcelPivot:
http://sandstorm36.blogspot.com.au/2012/12/ssexcelpivot-class-enhancements.html
http://sandstorm36.blogspot.com.au/2012/02/ssexcelpivot-class.html


Those classes are designed to be used generic as users may export different data to excel, in their own particular field ordering based on their needs.  But sometimes though, the generated output of these two classes may still lack something.  Like for instance, while I gave the ability to show total of a numeric columns like this:

      This._totalfields = 'Regular,OT,Holiday,Total'

Which will create a total on those 3 fields (vertically), I have not added a horizontal summation capability.  Why?  Because a user's exported data may vary based on the record source, the last may not be a column representing the numeric total of the fields on its left.

Is there a way to perform extra automation on the sheets generated by these classes?



Yes, of course that is why I created this post.  As I was busy most of the time and since no one asks before, then I always forgot to show or mention how to extend that.  Now, someone actually asked me how it can be done.

Unexplained Features:

These properties are actually explained in the simplest explanation on those links but since those posts are already long, I just left some details to the imaginations of the users.  But since no one seems to have thought of utilizing some of those properties to their advantages, I will now elaborate some overlooked features of those classes for your benefits on extra automation:

ssToExcel 1 and 2 Properties:

_cFolder = specify target folder destination.  Default is user's local temp folder
_FileName = to specify a filename other than default sys(3)
_lWithOutput = to show screen output of result or not, default is .T.

When you set _lWithOutput to .F., then the class will perform your hardcoded instructions to generate an excel output with formats, headings, etc.; then save it and exit excel outright without showing you the result (Silent).  You will just be given a prompt of Messagebox("Conversion Complete!")

ssExcelPivot Properties counterparts:

._filename = to specify a filename other than default sys(3)
._nooutput = This is the opposite of the above.  This is set to .F. by default. Set it to .T. so now screen output will happen (loExcel.Visible = .F.)


Now that we have successfully exported records with extra formats via ssToExcel classes (first or 2nd version) or has created the pivot report via ssExcelPivot class without showing us the end result on our screen, then we can now move to extra automation.

Performing Extra Automations

The first thing we need is to create a form property that will handle the filename of the output we've generated above on either ssToExcel or ssExcelPivot classes.  The main trick is to know the filename of those excel worksheets so that after those classes have done their work and generated the output, then we can reopen said file and perform some more automation on those.

Let us create as an example a simple Daily Time Record.  The barest commands we can issue to generate one is something like this:

Local ldStart, ldEnd
ldStart = Gomonth(Date(),-1)
ldEnd = Date()

Select EmpCode, Empname, Regular, OT, Holiday, Total ;
      FROM MyTable ;
      WHERE MyDate Between m.ldStart And m.ldEnd ;
      INTO Cursor junkrep NOFILTER

If _Tally > 0
      This._cursorname = 'junkrep'
      This._headings = "DAILY TIME RECORD|For the Period "+;
            DTOC(m.ldStart)+" to "+Dtoc(m.ldEnd))
      This._nopop = .T.
      This._totalfields = 'Regular,OT,Holiday,Total'
      DoDefault()
Else
      Messagebox('Nothing to export yet!',0+64,'Oooopppsss!')

Endif

But the problem with this, while I have a hardcoded instruction for creating totals of the columns via:

This._totalfields = 'Regular,OT,Holiday,Total'

The total field is not a calculated column.  Its value is fixed based  from the cursor.  However, if the need is say someone wants to encode further later in that excel output the values on OT and Holiday fields, then while the total of those columns will adjust, the Column total won't.

For this reason is why I am showing the way to extend these classes by means of further automation.

For additional automation to work, you need to have something to tie to to the intended output excel file.  It can be a _screen property, a global object, or simply a form property.  Once you know the filename to get back to, then performing additional automation on said file is a piece of cake.

Sample extended now:

Local ldStart, ldEnd
ldStart = Gomonth(Date(),-1)
ldEnd = Date()

Select EmpCode, Empname, Regular, OT, Holiday, Total ;
      FROM MyTable ;
      WHERE MyDate Between m.ldStart And m.ldEnd ;
      INTO Cursor junkrep NOFILTER
If _Tally > 0
      This._cursorname = 'junkrep'
      This._headings = "DAILY TIME RECORD|For the Period "+;
            DTOC(m.ldStart)+" to "+Dtoc(m.ldEnd))
      This._nopop = .T.

      * We have to save this now to a specific filename so we can perform extra automation later
      Local lcExcelSheet
      lcExcelSheet = Sys(3)
      This._filename = m.lcExcelSheet
      Thisform._excelrun = m.lcExcelSheet
      This._lwithoutput = .F.  && Don't show output

      This._totalfields = 'Regular,OT,Holiday,Total'
      DoDefault()

      * Perform additional automation
      Thisform._extraautomation()
Else
      Messagebox('Nothing to export yet!',0+64,'Oooopppsss!')
Endif

In the above, I now track the filename via a form property which I named _ExcelRun which stores the filename value, then a hardcoded instruction to not show the output but simply saves and exits via _lWithOutput = .F. property.  Then below I called another method in form I created and named _ExtraAutomation which has these codes:

#Define xlLastCell 11

Local lcFile, loExcel As Excel.Application, lnLastRow
* Get the file we worked on earlier
lcFile = FORCEEXT(ADDBS(GETENV("TMP"))+This._excelrun,'xls')
loExcel = Createobject("excel.application")
With loExcel
      .Workbooks.Open(m.lcFile)
      .ActiveCell.SpecialCells(xlLastCell).Select
      lnLastRow = .ActiveCell.Row
      .Range("E5").Select
      .Selection.FormulaR1C1 = "=SUM(RC[-7]:RC[-1])"
      .Selection.AutoFill(.Range("E5:E"+Transform(m.lnLastRow)))
      * show now
      .Visible = .T.
      Endwith

And the final result is a report in excel, nicely formatted and with horizontal calculated columns.


That is only a sample, you can do anything further on your end based on your need.  This post is just meant to show you the way how to extend the output of my classes.



I hope I have explained well because sometimes sharing a thought especially when you are rushing to do other things may result to a confusing write-ups.  But hey, I have to do a lot more other works on my end so just post a question below if you need one.

Cheers!

P.S.

If you are looking at the above image and you noticed Issuance button does not look like the button of my ssExcelPivot class, then you are right.  That is ButtonX class of ssUltimate theme 3.  Please read this as well for a somewhat related topic:  http://sandstorm36.blogspot.com.au/2014/04/working-on-invisible-objects.html

by Jun Tangunan (noreply@blogger.com) at April 08, 2014 04:55 AM

Excel, Knowing the last row per sheet

Here is a very simple automation trick on how to find out the last row on an Excel Sheet.  This also shows how to find out the number of sheets, how to transfer between those, plus knowing the last row of each sheet.

Enjoy!


#Define xlLastCell 11

Local lcFile, loExcel As Excel.Application, lnLastRow, lnloop
lcFile = Getfile("xls,xlsx")
If !Empty(m.lcFile)   && check if not cancelled
      loExcel = Createobject("excel.application")
      With loExcel
            .Workbooks.Open(m.lcFile)
            For lnloop = 1 To .sheets.Count
                  .Worksheets(m.lnloop).Select
                  .ActiveCell.SpecialCells(xlLastCell).Select
                  lnLastRow = .ActiveCell.Row
                  Messagebox('Sheet'+Transform(m.lnloop)+' last Row'+;
                                     Transform(m.lnLastRow))
            Next
            * Visually Check
            .Visible = .T.
      Endwith
Else
      Messagebox("Aborted by user!",0+64,"Oppppssss!")
Endif

by Jun Tangunan (noreply@blogger.com) at April 08, 2014 02:06 AM

April 07, 2014

Alex Feldstein

CULLY Technologies, LLC

Xojo on Linux: Part 2 of 2

or

There Can’t Be Only One

I originally was going to record and publish my development efforts with Xojo on Linux but … Xojo just worked. And it worked well. It wasn’t going to be very entertaining to watch me say “well, that worked!” over and over. I did measure a couple of key points: [1] what was the time it took to right click and the submenu to show up. This is a key metric on the performance of the distro. [2] Did the distro recognize that the screen was resized. The distro should (ideally) detect this and adjust the display accordingly. This would be if we swapped out monitors and it had a different native resolution. It is a really nice feature for a developer to be able to resize the VM window and have the desktop adjust.

Here’s a video of my current issue with performance on Ubuntu with the Unity desktop:

Take a look at my findings:

Distro Base Architecture Desktop Machine Xojo R+Click VM Live Resize
Ubuntu Debian 64 Unity PC 5s n/a
Ubuntu Debian 64 Gnome PC 3s n/a
Fedora 20 Independant 32 Gnome VM 4s No
Ubuntu Debian 32 Unity VM 4s No
Manjero Arch 32 Xfce VM 3s Yes
Lubuntu Debian 32 LXDE VM 2s No
Elementary Ubuntu 32 Gnome VM 1s Yes
Mint Ubuntu 32 Xfce VM 1s Yes
Mint Ubuntu 32 Cinnamon VM 1s Yes
Bodhi Ubuntu 32 Enlightenment VM 0s No
Fedora 20 Independant 32 MATE VM 0s No
OpenSUSE 13.1 Independant 32 KDE VM 0s Yes
SolydK Debian 32 KDE VM 0s Yes
SolydX Debian 32 Xfce VM 0s Yes
Mageia 4 Independant 32 KDE VM 0s Yes
  • Note: All base memory Vms are 4096 MB
  • Note: All Video Memory Vms are 64 MB
  • PC: memory 8088 MB
  • PC: Video Memory 128 MB

Bottom line: For developing Xojo on Linux, I’m recommending Linux Mint and/or SolydK. The performance is incredible even in a virtual machine. Before you write off some of these other distributions however, let me describe some of them for you.

Elementary OS: I know a lot of Xojo developers use Macs. Elementary32 011What distribution could you use that you would feel at home with? Perhaps try Elementary OS. You can see it looks a lot like the Mac OS X. Imitation is a sincere form of flattery. It’s not a slouch at a one second right+click menu behavior. I didn’t did have to manually install WebKit on the distribution to get the Xojo HTMLViewer to work but once done, it worked seamlessly.

Bodhi Linux: This is a very curious Linux distribution. Bodhi32 015It uses the ultra low weight desktop called Enlightenment, and it is blazing fast. However, it’s package manager is a bit … odd. Perhaps this isn’t a good option for daily development. My son loves this distribution which is running on his Dell mini9 laptop with an atom processor. It’s not his daily computer, but one that he takes with him around the house and when travelling.

Linux Mint with XFCE: Mint XFCE 016Paul Lefebvre of Xojo was singing Mint’s praises during the XDC conference. I hadn’t taken it for a spin in quite a while. It is bea-uti-ful. And fast! It works like it should and has a great repository of applications. Highly recommended.

SolydX with XFCE: (pronounced Solid+X) This is a newer distribution that is a “rolling release”. SolydX 012What this means is that you will never have to make a huge leap from an upgrade of one version to another. As an example, most distributions have you upgrade from Version 12 to Version 13 at some point. SolydX (and SolydK) are a rolling release that applications, desktops, etc. are tested and released continuously. This means that you get the new stuff quicker and there isn’t any nail+biting when upgrading from one version to the next. SolydX is blazing fast, solid (like it’s name!) and is a welcome addition to the list of distributions. Good on ya Solyd! Highly recommended.

SolydK with KDE: SolydK 013Wow. What a looker. I used to be a KDE man, but gave it up when I jumped on the Ubuntu bandwagon. Now that I’m taking it for another spin, I’m seeing what a huge leap the KDE team has made over the years. Stunningly beautiful with great effects, works great with Xojo, and is as fast as XFCE. How is that possible? I have no clue. I have fallen in love and her name is SolydK. Am I being fickle or will this love last? We’ll see but this is what I’ll be using as my development platform when developing Xojo apps for a near future.

Update with new results! Apr 10, 2014
Fedora with Gnome: Based on a request, I took Fedora for a spin and … I’m disappointed. There distro wouldn’t live resize in VirtualBos, there were some strange artifacts when moving the mouse around, and Xojo appeared to be slow with this distribution. Right+click times were 3-4 seconds. On top of that, I couldn’t get WebKit downloaded and installed using their package manager. This isn’t to say that a lighter weight distribution wouldn’t have performed better. I give lots of street cred to Fedora and its
history, but it doesn’t seem to be a leading contender for Xojo developers.

Update with new results! Apr 11, 2014
Fedora with MATE: We’re back in the game with the performance of MATE on top of Fedora 20. Speedy. You get the parity in looks with MATE as you do with Gnome 3, but you get the speed of the other desktops like KDE and XFCE. The developers have done a good job keeping their workings similar. Thumbs up for MATE and Fedora for Xojo developers.

Update with new results! Apr 15, 2014
OpenSUSE with KDE: With the love I was showing for KDE with SolydK, I felt I needed to give OpenSUSE a spin and I’m glad I did. Sub 1 second right+click performance with Xojo2014r1, and the beautiful KDE transparancy effects make for a nice development environment. Throw in the live desktop resizing when resizing the VM window and we’re on our way to a contender. The only issue I ran into is that WebKit needed to be installed before the HTMLViewer would work, but a quick visit to YAST and a checkmark and an install quickly resolved that issue. No big deal.

Update with new results! Apr 16, 2014
Mageia with KDE: Mageia is a fork of Mandriva from a couple of years ago. I was wondering if this was just going to be ‘just another Linux’. I am pleased to say that it isn’t. Sure, KDE is pretty much the same, and the underlying Linux is the same. However, I’m very pleased with the level of control of the setup during the install. I had the option to set GRUB options, how to configure the hard drive partitions, and other nice options. I appreciate that! It wasn’t overly complex, it just gave me more installation options that I think some people will really appreciate. Desktop resizing worked as expected with KDE. So, how does Xojo run on Mageia? In a word: great! Right+click performance is sub second. The HTMLViewer (based on WebKit) worked with no extra installation needed. Thumbs up.

Here I am taking SolydK for a spin:

Summary: Here’s my approach…

  1. Keeping with Ubuntu 64bit OS … for now. I paid for a 64bit PC and I’m going to use it, dammit!
  2. I’m moving my Xojo development into the SolydK 32bit distro in a VirtualBox VM. Fast and beautiful.

Do you have questions about a distribution that you didn’t see me review? Leave a comment down below.

Happy developing in Xojo you future Linux fans! Give it a try and you’ll find that just like anything, it might take just a bit more effort but the liberty of running Linux is worth it. Take care.

by kcully at April 07, 2014 07:00 PM

Xojo on Linux: Part 1 of 2

or

What is a Distro anyway? and why are there so dang many of them?

While at the Xojo Developers Conference (XDC), I was hearing a lot of developers saying that they didn’t develop for Linux because “there are so many distributions!”  The perception is that each distribution does things so differently, that it makes it hard to develop on Linux.  I’m hoping to correct some of these misconceptions.

The truth is, that Xojo makes developing for Linux easy.

Here’s the main point: The plumbing of Linux is almost all the same from distro to distro. Xojo uses the GTK control set and almost each and every Linux distribution comes with that installed so your Linux distributions should just … run and run just fine. Period.

If what I said above is true, then why are there so many distributions?!?  Here’s my quick video explaining it as I see it.

So when you think “Distro”, think [1] the GNU/Linux part is all the same. [2] The Base basically works on how the distro and applications are updated and how often. [3] There is a desktop and a theme that gives you an initial look and feel.  [4] Finally, there is a certain set of applications installed that the distro has chosen.  You can add more if you like. In fact, you can change all of this up to suit you.

So … there are tons of distributions, and that’s a good thing.  In fact, I’m currently having trouble with Ubuntu running the Unity desktop.  Xojo runs slow on it because Unity draws to the screen really slow.  The remedy: try another distribution!  FREEDOM FOR THE WIN!  (More on this in part two!)

The main problem I am currently having with Xojo on Ubuntu Linux is the time it takes to right+click on a control and for the menu to appear. It takes a whole 5 seconds for the menu to appear!  Unacceptable.  Is this the fault of Xojo or Linux itself?  It turns out that it is NOT!  On the same machine running the GNOME desktop, it takes 3 seconds.  Still not good enough.  I won’t spoil the results, but there are several distributions that take 0 (zero) seconds for the menu to appear.  That’s more like it! It can’t get much better than zero seconds!

Imagine that your new version of Mac OS X started taking 5 seconds when you right+click on a control.  What options would you have?  What if Windows 8.2 delayed your development efforts?  We could hope for relief from Xojo, but it wasn’t their fault to begin with.  With Linux, we have lots of options.

There’s some issues with Xojo of course, but lets take a look at these issues.

The 32 bit problem: Linux users (mostly because if you’re currently a Linux users, you’re hard core!) more quickly transitioned to 64 bit than Mac and Windows users. The Linux distributions typically don’t bundle the 32 bit libraries in their distributions any more.  Mac and Windows operating systems still bundle them as part of their standard installation.  It’s easy to get the 32 bit libraries as a developer.  These two lines will get you the libraries on Debian based Linux distros:

sudo apt-get install ia32-libs
sudo apt-get install ia32-libs-multiarch

If you develop an application, in your package you can specify that that these libraries are a dependency and they will be installed when your application is installed. When you get it down once, it will always be done. I’m hoping that Xojo gets their 64 bit version released sometime early in 2015.

The WebKit problem: Xojo uses the WebKit browser for their HTMLViewer.  It’s very powerful and a great way to display information to the user.  There’s a problem using Xojo and 64 bit versions of Linux.  This is a big problem and one that I haven’t fully resolved yet.  All I can say is I hope the 64 bit version comes sooner than later.  I think I already said that in the previous paragraph, but this is a sticking point.  I’m calling it like I see it. It won’t be a problem forever.  The ease of developing a Linux application in Xojo outweighs some awkward issues we’re currently having.  Growing pains, right?!?

Stay tuned in part 2, where we take one of my recommended Linux’s for a quick spin.

 

by kcully at April 07, 2014 05:59 PM

FoxProWiki

UpcomingEvents

A place to list upcoming Visual FoxPro events like conferences, meetings, user groups, open training sessions...

April 07, 2014 11:19 AM

Alex Feldstein

April 06, 2014

Alex Feldstein

Photo of the Day


Left pattern on Kendall-Tamiami (KTMB) Runway 27L flying in a Ford Trimotor

by Alex Feldstein (noreply@blogger.com) at April 06, 2014 05:00 AM

April 05, 2014

FoxProWiki

GetPopEmail

Hey all - are the references to oSocket below supposed to be ocxSocket? -- Mike Yearwood

April 05, 2014 04:15 PM

Alex Feldstein

Photo of the Day


Left pattern on Kendall-Tamiami (KTMB) Runway 27L flying as a passenger in a Ford Trimotor

by Alex Feldstein (noreply@blogger.com) at April 05, 2014 05:00 AM

VisualFoxProWiki

MichaelWagner

Editor comments: Updating after a long time
Returning to this page almost 8 years later, almost everything is out of date. I'll come back and update it when time permits.

I also run a blog called Stamping Out a Living, about working in the metal stamping industry
http://www.stampingoutaliving.com. Last week Stamping Out a Living was selected as site of the week by metals.about.com (much to my surprise!).

I do most of our custom programming in Foxpro. Have done so for more than 10 years now. We started with Foxpro 2.0 for DOS in the early '90s. Before that, I used DBXL for a while in the late '80s. Wrote an application to statistically analyze larval stages of onion maggots for an agricultural research station to predict the best times to spray with pesticides (really!).

And I'm a dancer and a DJ. I DJ using a slim devices Squeeze Box and an app I wrote in, what else, Foxpro.
http://www.dancersdelight.ca

My programming credentials:
Started studying computers while still in high school.
Awarded a scholarship ("studentship") to York University between grade 12 & 13, assisting an astronomy grad student with his computing requirements. Worked in Watfor. Taught myself PL/I during that time.
After grade 13, wrote a cost accounting program for Web Offset, a Toronto offset printing company, in PL/I.
Took half a year off to travel.
Returned to University of Toronto where studied Computer Science 1974-1977
Worked one summer for the Faculty of Arts and Science registrars office as computer support programmer.
Worked next 2 summers as an "advisor" for the University of Toronto Computing Services
This became a fulltime job 1977-87, first as a programmer, then programmer analyst, then performance analyst, then supervisor of programmer/analysts. Worked on large IBM mainframes running MFT, MVT, MVS, VM, and Amdahl's version of Unix System 7 running under VM. Head of the Share VM Performance Project (roughly) from 1984-1987.
Left the university (initially as a sabatical) to go to Europe and work directly for GMD (Gessellschaft fuer Mathematik und Datenverarbeitung - roughly, Institute for Mathematics and Computer Science), as part of a contract for a part of the German Civil Service roughly equivalent to the National Research Council, working on electronic mail and specifically an RFC822<=>X.400 bridge.
Returned to Canada but not the university. Consulted for 2 years in various engineering/scientific projects.
Ended up doing most of my consulting for a manufacturing company my parents started in 1958.
Ended up becoming an employee.
Ended up becoming the owner as my parents retired.
2014 update:
Sold the metal stamping company.
Left the metal business.
Pretty much gave up on StampingOutALiving.
Worked for an interior renovations company for the last 5 years.

April 05, 2014 01:17 AM

April 04, 2014

Sandstorm's Blog (Home of ssClasses)

Localized Data II - Animated Weather

They say a picture paints a thousand words so I will try to show here my weather forecast section and what the animation effect brings to that.

IMHO, this gives a better feel for the users of my app than the normal weather animations we see on the web or on our mobile gadgets.  Plus I always like to have something unique for my apps.

Now, for you be able to achieve the same effect, what you need to do is download animated images from the web, create a table for it, store it to a memo or blob field, and create another field to trap the weather condition which is unique with the web site you will be getting your forecast from.

Like I said with the first blog about this, what I do then on my end is refresh data every 60 seconds and display result on the section of my form for that.  Then I perform an SQL SELECT to get all animations stored on my table which has the same weather condition on the current hour forecast, and finally picks one randomly to be shown above the forecast.

Here is the section of said weather forecast for you to see.  Although the image of the grid representing the forecast is not clear here because I have to resize it larger to fit with the animated image I have shown here whereas on my app, it is the other way around.  The animated image is stretched to fit with the same size of my actual grid below.

Foolish me!  I like this animated image of raining so I chose it.  So as not to confuse the readers, I've overwritten the Cloudy weather with Heavy Rain but forgot to change the caption of Current Weather.  LOL!


And here is the portion where it randomly picks for an animated image:

* Select Animation
Use weather In 0 Shared
Use weathergrp In 0 Shared
With This.imgweather
      .Picture = ''
      * Get an animation based on Weather
      Select t1.wimage, t2.Descript From weather t1;
            LEFT Outer Join weathergrp t2;
            ON t2.wgpk = t1.wgfk;
            WHERE Alltrim(t2.Descript) == m.lcWeather ;
            Into Cursor JunkWeather NOFILTER
      If _Tally > 0
            Goto (1 + _Tally * Rand( ))
            lcImage = Addbs(Getenv("TEMP"))+'weather.gif'
            Strtofile(JunkWeather.wimage,m.lcImage)
            .Picture = m.lcImage
            .Visible = .T.
      Else
            .Visible = .F.
      Endif
      Use In Select('Weather')
      Use In Select('WeatherGrp')
Endwith
      * End of Select Animation

Its advantage is speed, being all data are localized.  You won't see it lagging as both the weather forecast info and weather animation is updated/changed in a split second .

You can achieve the same on your end, just follow the ideas I shared here and in the first part of localized data blog.  Cheers!


by Jun Tangunan (noreply@blogger.com) at April 04, 2014 11:04 PM

Localized Data

Cousin Glen shared a way to put the weather on our form in his blog as well as in foxite last time and so when I decided that I finally needed one because we are working simultaneously on several road construction projects these days and the weather forecast will be helpful, I did not need to look far away and simply checked what he has shared which is via XMLHttpRequest.

What is XMLHttpRequest?

XMLHttpRequest (XHR) is an API available to web browser scripting languages such as JavaScript. It is used to send HTTP or HTTPS requests to a web server and load the server response data back into the script.  http://en.wikipedia.org/wiki/XMLHttpRequest

Using XMLHttpRequest has some (expected) peculiarities like it appears based on my observation that the previous request is compounding seeing my laptop which is doing the data fetching getting slower over time. Thus, I informed him of such and we decided to do these additional things:


  • Checking Current State of the Request.  Well, it is also better to perform a check to know the current state of the request operation via XMLHttpRequest's ReadyState property. Its value would be 4 when all the data has been received.  
  • Release the current request via XMLHttpRequest's abort method after transferring ResponseText value.
  • Clearing Cache - If you don't clear the cache after the processing of the request, chances are you'll get the same result over and over again. Glen gave me another Function called DeleteUrlCacheEntry to fix that. 
For a deeper understanding of XMLHttpRequest, check this link:  http://msdn.microsoft.com/en-us/library/ie/ms535874(v=vs.85).aspx


Processing Request Lags

We are almost set to get what we need.  However, another thing that we cannot remove is during when the HTTP request is being processed, that your unit will experience a lag which is more than a tick or two depending on the speed of your internet connection on your end.  And if so, during said HTTP request you may experience a somewhat short frozen state on your app until such time the whole request process is completed and response returned back to you.  And I dare say most users won't be happy with said lag.

Is there a way to avoid such then?

Avoiding Lags

There actually is no way to remove the HTTP request processing lag but we do can avoid that.  Remember this?  http://sandstorm36.blogspot.com.au/2012/11/run-vfp-app-like-service.html

So the trick to avoid such lags is to create another small app with, among its other jobs, is to send those HTTP requests and save the result to your local drive. Mine is set to get the info every 5 minutes.  Since this app is running on another thread of its own, then your main app won't be bothered by such request lags and all you need to do later is to fetch the data from the text file it generates/updates continuously.

Service Application

I called this as service application because it does service the needs of my main ERP app like performing compressed backup, cleaning, and other things on a specified time.  Now I added the XMLHttpRequest and so I will show here the portion that deals with that:

***************
bcService.prg
***************

*For reducing memory eaten by the process
Declare Integer SetProcessWorkingSetSize In kernel32 As SetProcessWorkingSetSize  ;
      Integer hProcess , ;
      Integer dwMinimumWorkingSetSize , ;
      Integer dwMaximumWorkingSetSize
Declare Integer GetCurrentProcess In kernel32 As GetCurrentProcess

* For Clearing URL Cache
Declare Integer DeleteUrlCacheEntry In wininet String lpszUrlName


On Error Wait Window '' Nowait

Set Classlib To Addbs(Home(2))+'Solution\Toledo\systray.vcx' 
Local loSysTray, loTimer
loSysTray = Createobject('myTray', 'systray.vcx')
loSysTray.AddIconToSystray()

*** Add the needed properties
Private oServices
oServices = Createobject('EMPTY')
AddProperty(oServices,'Folder',Addbs(Justpath(Sys(16,0))))
AddProperty(oServices,'GetURLCounter',0)  && So it will run outright the first run
AddProperty(oServices,'GetURLSet',300)   && 5 minutes interval
Set Default To (Fullpath(oServices.FolderData))

loTimer = Createobject( "myTimer" )
Read Events

Define Class myTray As systray
      IconFile    = Addbs(Justpath(Sys(16,0)))+"bcservice.ico"

      * Use Double-click to exit service
      Function iconDblClickEvent
            If Messagebox('Do you really want to stop this service?',4+32,'Oooppppssss!') = 6
                  Clear Events
            Endif
      Endfunc
Enddefine

Define Class myTimer As Timer
      Interval = 1000

      Function Timer
            * Get URL Requests based on parameter passed or default value
            oServices.GetURLCounter = oServices.GetURLCounter - 1
            If oServices.GetURLCounter <= 0
                  Local o As msxml2.xmlhttp, lcURL, lnloop, lcHTMLText, lcWord
                  lcHTMLText = 'Weather,PGKPHP,USDPHP,PGKINR,USDINR,PGKIDR,USDIDR,PGKUSD'
                  For lnloop = 1 To 8
                        lcWord = Getwordnum(m.lcHTMLText,m.lnloop,',')
                        If m.lnloop = 1
                              lcURL = [http://www.accuweather.com/en/pg/lae/258839/hourly-weather-forecast/258839]
                        Else
                              lcURL = [http://www.xe.com/currencyconverter/convert/?Amount=1&From=]+;
                                    LEFT(m.lcWord,3)+[&To=]+Right(m.lcWord,3)
                        Endif
                        o = Createobject("msxml2.xmlhttp")
                        o.Open("GET",m.lcURL,.F.)
                        o.Send(.Null.)
                       
                        Do While o.readyState <> 4  && Check if all data is received
                        ENDDO
                       
                        If !Empty(o.responseText)
                              Try
                                    lcFile = Addbs(oServices.Folder)+m.lcWord
                                    Strtofile(o.responseText,m.lcFile,0)
                                    Wait Window 'Update of '+m.lcWord+' Complete....' Nowait
                              Catch
                              Endtry
                        Endif
                        * Clean up
                        o.abort
                        o = Null
                        DeleteUrlCacheEntry(m.lcURL)
                  Next
                  oServices.GetURLCounter = oServices.GetURLSet
            ENDIF
           
            ***** Perform other more tasks

            * Reduce Memory
            SetProcessWorkingSetSize(GetCurrentProcess(),-1,-1)
      Endfunc
Enddefine

************ End 

Now, why in the heck did I named this post localized data?  

That is because my main app is actually working on files stored locally on my unit, never caring for the info coming from web or the lag it creates as the other (service) app takes care of that need.  And in this way, there is absolutely no lag on updating the latest data on my main ERP app and further disseminating those information across the LAN for my other users to see.   

Another reason why I decided to name this as localized data is because of the way I implemented my weather forecast widget.  The animated weather showing the current hour's weather forecast do not come from the web on every change of the weather.  Those are originally from the web which I downloaded and stored onto a table (not much records and won't change so I store in a table).  Then I fetch a set via an SQL SELECT based on the current weather and pick one randomly to be shown on my form.

Said animated weather image changes every 60 seconds in coordination with the current weather forecast, and the information changes as well based on whether an update has already been made by the service app.

Here is my BizCore ERP app's main screen/form:



Recap:

  • Create a separate app running on its own process to get the data from the web
  • Use the downloaded files to update your main app

I hope this gives others some ideas.

Cheers

by Jun Tangunan (noreply@blogger.com) at April 04, 2014 07:08 AM

www.atoutfox.org - Contributions

Session "Design Patterns"

Le contenu de la session en trois parties.

1 - Les diapositives au format PDF.

2 - Le fil conducteur sous la forme d'un fichier PDF avec trois bonus : le début d'un exemple sur le patron "visiteur" préparé en cas de session trop courte, la description des 23 patrons du GoF par les auteurs eux-mêmes, les quelques liens que j'ai visité pour domestiquer le sujet.

3 - Les programmes VFP qui illustrent mon propos.

Bonne lecture.

by Marc Thivolle at April 04, 2014 05:16 AM

Alex Feldstein

April 03, 2014

Alex Feldstein

April 02, 2014

Articles

MSCC: Global Windows Azure Bootcamp

Logo of the Mauritius Software Craftsmanship CommunityMauritius participated and contributed to the Global Windows Azure Bootcamp 2014 (GWAB). Again! And this time stronger than ever, and together with 137 other locations in 56 countries world-wide.

We had 62 named registrations, 7 guest additions and approximately 10 offline participants prior to the event day. Most interestingly the organisation of the GWAB through the MSCC helped to increased the number of craftsmen.

The Mauritius Software Craftsmanship Community has currently 138 registered members - in less than one year!

Only with those numbers we can proudly say that all the preparations and hard work towards this event already paid off. Personally, I'm really grateful that we had this kind of response and the feedback from some attendees confirmed that the MSCC is on the right track here on Cyber Island Mauritius.

Inspired and motivated by the success of this event, rest assured that there will be more public events like the GWAB.

This time it took some time to reflect on our meetup, following my first impression right on spot:

"Wow, what an experience to organise and participate in this global event. Overall, I've been very pleased with the preparations and the event itself. Surely, there have been some nicks that we have to address and to improve for future activities like this. Quite frankly, we are not professional event organisers (not yet) but we learned a lot over the past couple of days.

A big Thank You to our event sponsors, namely Microsoft Indian Ocean Islands & French Pacific, Ceridian Mauritius and Emtel. Without them this event wouldn't have happened - Thank You!

And to the cool team members of Microsoft Student Partners (MSPs). You geeks did a great job! Thanks!"

So, how many attendees did we actually have? 61! - Awesome - 61 cloud computing instances to help on the research of diabetes.

During Saturday afternoon there was even an online publication on L'Express: Les développeurs mauriciens se joignent au combat contre le diabète

Reactions of other attendees

Don't take my word for granted... Here are some impressions and feedback from our participants:

"Awesome event, really appreciated the presentations :-)" -- Kevin on event comments

"very interesting and enriching." -- Diana on event comments

"#gwab #gwabmru 2014 great success. Looking forward for gwab 2015" -- Wasiim on Twitter

"Was there till the end. Awesome Event. I'll surely join upcoming meetup sessions :)" -- Luchmun on event comments

"#gwabmru was not that cool. left early" -- Mohammad on Twitter

The overall feedback is positive but we are absolutely aware that there quite a number of problems we had to face. We are already looking into that and ideas / action plans on how we will be able to improve it for future events.

The sessions

We started the day with welcoming speeches by Thierry Coret, Sr. Marketing Manager of Microsoft Indian Ocean Islands & French Pacific and Vidia Mooneegan, Managing Director and Sr. Vice President of Ceridian Mauritius. The clear emphasis was on the endless possibilities of cloud computing and how it can enable any kind of sectors here in the country.

Then it was about time to set up the cloud computing services in order to contribute each attendees cloud computing resources to the global research of diabetes, a step by step guide presented by Arnaud Meslier, Technical Evangelist at Microsoft. Given a rendering package and a configuration file it was very interesting to follow the single steps in Windows Azure. Also, during the day we were not sure whether the set up had been correctly, as Mauritius didn't show up on the results board - which should have been the case after approximately 20 to 30 minutes. Anyways, let the minions work...

Next, Arnaud gave a brief overview of the variety of services Windows Azure has to offer. Whether you need a development environment for your websites or mobiles app, running a virtual machine with your existing applications or simply putting a SQL database online. No worries, Windows Azure has the right packages available and the online management portal is really easy t handle.

After this, we got a little bit more business oriented while Wasiim Hosenbocus, employee at Ceridian, took the attendees through the inerts of a real-life application, and demoed a couple of the existing features. He did a great job by showing how the different services of Windows Azure can be created and pulled together.

After the lunch break it is always tough to keep the audience awake... And it was my turn. I gave a brief overview on operating and managing a SQL database on Windows Azure. Well, there are actually two options available and depending on your individual requirements you should be aware of both. The simpler version is called SQL Database and while provisioning only takes a couple of seconds, you should take into consideration that SQL Database has a number of constraints, like limitations on the actual database size - up to 5 GB as web edition and up to 150 GB maximum as business edition -, among others.

Next, it was Chervine Bhiwoo's session on Windows Azure Mobile Services. It was absolutely amazing to see that the mobiles services directly offers you various project templates, like Windows 8 Store App, Android app, iOS app, and even Xamarin cross-platform app development. So, within a couple of minutes you can have your first mobile app active and running on Windows Azure. Furthermore, Chervine showed the attendees that adding another user interface, like Web Sites running on ASP.NET MVC 4 only takes a couple of minutes, too.

And last but not least, we rounded up the day with Windows Azure Websites and hosting of Virtual Machines presented by some members of the local Microsoft Students Partners programme. Surely, one of the big advantages using Windows Azure is the availability of pre-defined installation packages of known web applications, like WordPress, Joomla!, or Ghost. Compared to running your own web site with a traditional web hoster it is surely en par, and depending on your personal level of expertise, Windows Azure provides you more liberty in terms of configuration than maybe a shared hosting environment. Running a pre-defined web application is one thing but in case that you would like to have more control over your hosting environment it is highly advised to opt for a virtual machine. Provisioning of an Ubuntu 12.04 LTS system was very simple to do but it takes some more minutes than you might expect. So, please be patient and take your time while Windows Azure gets everything in place for you. Afterwards, you can use a SecureShell (ssh) client like Putty in case of a Linux-based machine, or Remote Desktop Services when operating a Windows Server system to log in into your virtual machine.

At the end of the day we had a great Q&A session and we finalised the event with our raffle of goodies. Participation in the raffle was bound to submission of the session survey and most gratefully we had a give-away for everyone. What a nice coincidence to finish of the day.

Note: All session slides (and demo codes) will be made available on the MSCC event page. Please, check the Files section over there.

(Some) Visual impressions from the event

Just to give you an idea about what has happened during the GWAB 2014 at Ebene...

Speakers and Microsoft Student Partners are getting ready for the Global Windows Azure Bootcamp 2014
Speakers and Microsoft Student Partners are getting ready for the Global Windows Azure Bootcamp 2014

GWAB 2014 attendees are fully integrated into the hands-on-labs and setting up their individuals cloud computing services
GWAB 2014 attendees are fully integrated into the hands-on-labs and setting up their individuals cloud computing services

60 attendees at the GWAB 2014. Despite some technical difficulties we had a great time running the event
60 attendees at the GWAB 2014. Despite some technical difficulties we had a great time running the event

GWAB 2014: Using the lunch break for networking and exchange of ideas - Great conversations and topics amongst attendees
GWAB 2014: Using the lunch break for networking and exchange of ideas - Great conversations and topics amongst attendees

There are more pictures on the original event page:

Questions & Answers

Following are a couple of questions which have been asked and didn't get an answer during the event:

  • Q: Is it possible to upload static pages via FTP?
    • A: Yes, you can. Have a look at the right side column on the dashboard of your website. There you'll find information about the FTP and SFTP host names. You can use any FTP client, like ie. FileZilla to log in. FTP also gives you access to your log files.
  • Q: What are the size limitations on SQL Database?
  • Q: What's the maximum size of a SQL Server running in a Virtual Machine?
  • Q: How can we register for Windows Azure?
    • A: Mauritius is currently not listed for phone verification. Please get in touch with Arnaud Meslier at Microsoft IOI & FP
  • Q: Can I use my own domain name for Windows Azure websites?
    • A: Yes, you can. But this might require to upscale your account to Standard.

In case that I missed a question and answer, please use the comment section at the end of the article. Thanks!

Final results

Every participant was instructed during the hands-on-lab session on how to set up a cloud computing service in their account. Of course, I won't keep the results from you... Global Azure Lab

GWAB 2014: Our cloud computing contribution to the research of diabetes
GWAB 2014: Our cloud computing contribution to the research of diabetes

And I would say Mauritius did a good job!

Upcoming Events

What are the upcoming events here in Mauritius? So far, we have the following ones (incomplete list as usual) in chronological order:

Hopefully, there will be more announcements during the next couple of weeks and months. If you know about any other event, like a bootcamp, a code challenge or hackathon here in Mauritius, please drop me a note in the comment section below this article. Thanks!

Networking and job/project opportunities

Despite having technical presentations on Windows Azure an event like this always offers a great bunch of possibilities and opportunities to get in touch with new people in IT, have an exchange of experience with other like-minded people. As I already wrote about Communities - The importance of exchange and discussion - I had a great conversation with representatives of the University des Mascareignes which are currently embracing cloud infrastructure and cloud computing for their various campuses in the Indian Ocean. As for the MSCC it would be a great experience to stay in touch with them, and to work on upcoming, common activities.

Furthermore, I had a very good conversation with Thierry and Ludovic of Microsoft IOI & FP on the necessity of user groups and IT communities here on the island. It's great to see that the MSCC is currently on a run and that local companies are sharing our thoughts on promoting IT careers and exchange of IT knowledge in such an open way. I'm also looking forward to be able to participate and to contribute on more events in the near future.

My resume of the day

We learned a lot today and there is always room for improvement!

It was an awesome event and quite frankly it was a pleasure to spend the day with so many enthuastic IT people in the same room.

It was a great experience to organise such event locally and participate on a global scale to support the GlyQ-IQ Technology in their research on diabetes. I was so pleased to see the involvement of new MSCC members in taking the opportunity to share and learn about the power of cloud computing. The Mauritius Software Craftsmanship Community is on the right way and this year's bootcamp on Windows Azure only marked the beginning of our journey.

Thank you to our sponsors and my kudos to the MSPs!

by Jochen Kirstaetter (jochen@kirstaetter.name) at April 02, 2014 09:18 AM

Alex Feldstein

Sandstorm's Blog (Home of ssClasses)

Combobox using RowSourceType = 3, How to update content?

Well I use this to answer inside foxite forum earlier but then I just thought maybe some does not know yet how to use a cursor from an SQL SELECT as RowSource of a combobox, or if some do, they are maybe wondering how to update such when there is a change from the source table/cursor, in result keeping them away over its usage on a combobox; so I transferred it over here as part of my simple tutorials.

You see, I prefer to work on cursors on my end as that makes my app works faster, less prone to corruption (possibility of corruption may happen only during transferring of data from cursor to actual table), and easier to maintain.

So I use cursors on grids, listbox, combobox, etc.  However, some may have been wondering that if they use a cursor for a combobox RowSource, how to update said combobox then when there is a change in data from the actual table it is coming from?  Or in other words, how to show the changes back to the combobox when it is already set to run on a cursor that was created earlier than when the change on the actual source table/cursor happened?

The answer to that is a simple .Requery() event.  No additional codes needed, just plain 'ol .Requery().  See the images below:


And here are the sample codes I used on that:

loTest = Createobject("frmCombo")
loTest.Show(1)

DefineClassfrmCombo As Form
      AutoCenter = .T.


      Add Object text1 As TextBox With ;
            top = 50,;
            left = 10,;
            width = 60

      Add Object text2 As TextBox With ;
            top = 50,;
            left = 90,;
            width = 200

      Add Object grid1 As Grid With;
            top = 90,;
            left = 10,;
            width = 300,;
            Height = 100,;
            RecordSource = 'MyTable'

      Add Object command1 As CommandButton With ;
            top = 210,;
            left = 10,;
            Caption = '\<Update Combobox',;
            AutoSize = .T.
           
      ADD OBJECT label1 as label WITH;
            top = 210,;
            left = 150,;
            Width = 200,;
            Caption = 'Change content of grid and click Update Combobox button',;
            Wordwrap = .T.,;
            Height = 60

        * This time I am using RowSourceType 3 or an SQL SELECT statement.  I am 
          really creating a cursor now out of the source table/cursor
      Add Object combo1 As ComboBox With ;
            RowSourceType= 3,;
            RowSource = 'Select * from MyTable order by 1 into cursor MyCursor NOFILTER',;
            Style = 2,;
            top = 10,;
            left = 10,;
            Width = 200,;
            ColumnCount = 2,;
            ColumnWidths = '30'

      Procedure Load
            * I use cursor here so a physical table won't be created on your
              end. Pretend this is a table instead of cursor
            Create Cursor MyTable (xCurrency c(3), xCountry c(30))
            Insert Into MyTable Values ('PHP','Philippines')
            Insert Into MyTable Values ('PGK','Papua New Guinea')
            Insert Into MyTable Values ('AUD','Australia')
            Go Top
      Endproc

      Procedure combo1.InteractiveChange
            Thisform.text1.Value = MyTable.xCurrency
            Thisform.text2.Value = MyTable.xCountry
      Endproc

      Procedure command1.Click
            Thisform.combo1.Requery()
      Endproc

Enddefine

*********** End

And there you are!  Cheers!

by Jun Tangunan (noreply@blogger.com) at April 02, 2014 04:48 AM

Rahul Desai's Blog

April 01, 2014

VisualFoxProWiki

UpcomingEvents

Editor comments: Philly April and May
A place to list upcoming Visual FoxPro events like conferences, meetings, user groups, open training sessions...
Closest at the top please, and please remove past events.

April 01, 2014 10:13 PM

FoxCentral News

Philadelphia VFP User Group--Tuesday April 8

Our speaker this month (remotely from Madison, WI) is Eric Selje. His topic is "Don't be a Target!" For the last few months we've watched with fascination the developing story of the data breach at Target, Neiman Marcus, Michael's and others. In this session we'll take a look at how the thieves accomplished this feat including what they do with their takings, how it might have been prevented, and why the banks may not care all that much. Along the way you'll learn ways to secure your own information so your business doesn't become the next Target. Though this doesn't particularly have to do with VFP directly, many of us are subcontractors as well as network pros, DBAs, etc. and there are quite a few lessons to be learned from the Target data breach.

by Philadelphia Visual FoxPro User Group at April 01, 2014 09:18 PM

VFP Philly

April 8--Eric Selje on the Target data breach



Our next meeting is next Tuesday, April 8.

Our speaker this month (remotely from Madison, WI) is Eric Selje. His topic is “Don't be a Target!”

Bio: Eric Selje is a software developer in Madison, WI. He has been programming in Fox since FoxBase 1.21 in 1986 and recalls eagerly waiting for the box from UPS with "FoxPro". In 1995 he founded MadFox, the Madison FoxPro User Group, after attending DevCon in San Diego and realizing that learning Visual FoxPro 3 would take a group effort.

Eric is professionally known as Salty Dog Solutions, LLC, developing business applications for the desktop, web, and most recently mobile devices with an emphasis on database-driven applications. He is also co-author of VFPX: Open Source Treasure for the VFP Developer.

When he's not planted in front of a screen, Eric can most often be found on the Ultimate field, the baseball diamond, solving crosswords, or with his face in a book.

Abstract:

For the last few months we've watched with fascination the developing story of the data breach at Target, Neiman Marcus, Michael's and others. In this session we'll take a look at how the thieves accomplished this feat including what they do with their takings, how it might have been prevented, and why the banks may not care all that much. Along the way you'll learn ways to secure your own information so your business doesn't become the next Target.
Though this doesn't particularly have to do with VFP directly, many of us are subcontractors as well as network pros, DBAs, etc. and there are quite a few lessons to be learned from the Target data breach.

by Tamar E. Granor (noreply@blogger.com) at April 01, 2014 08:47 PM

Alex Feldstein

Rick Strahl's Web Log

Updated ASP.NET Database Resource Provider

A few years back I wrote an article on creating a custom ASP.NET Localization Resource Provider that described how to create a custom ASP.NET ResourceProvider and ResourceManger that get resources from a database. It’s an older article but it’s been one of the more popular ones on this site, and the resource provider described has been picked up (based on feedback received) by quite a good number of developers.

In the last month I put a bit of effort into cleaning up the original provider and the result is a more formal Westwind.Globalization library that I hope more people will check out and take advantage of.

In the process I added better documentation, set up a new home page, created a GitHub project for the source code (moved from the old Westwind Web Toolkit project) and created a NuGet package that makes it easy to integrate the provider into your own applications.

I also created a new Getting Started video:

that takes you through installing and setting up the provider, adding some resources using the resource editor, and then demonstrate a variety of ways that you can use the localized resources. It’s a combo Getting Started and basic features overview – check it out if you have a few minutes to spare.

Why now?

The provider’s been around for a number of years, and it’s been updated and bug fixes have been made based on user submissions and bug reports. But the project has been off the beaten track. There was the article with the download, and the library was embedded as part of the Westwind West Wind Toolkit that’s now been broken up into its smaller component parts as separate projects. Westwind.Globalization was one of the last small projects left mainly because some work was required to clean up some of the samples and go the final mile to create a redistributable version of the online Web Resource Editor.

Additionally, in the last year or so I’ve been involved in several apps that have made fairly heavy use of this provider and as part of those project I was able to add a number of enhancements that came up in the process. I found some time to smooth out some of the rough edges in the provider and front end integration pieces.

Among the enhancements:

  • Better support for resources in MVC/WebAPI – or any .NET app really (console, service, desktop)
    (you can use DbRest.T() anywhere, or generate strongly typed resources that work either with ResX or Db resources)
  • Improved standard ResourceManger implementation for any .NET application
  • New DbRes helper class that allows direct access to resources bypassing ResourceProviders
    (ie. no resource provider config required in ASP.NET)
  • Improved strongly typed resource generation
  • Much improved Db Resource –> Resx export capabilities
  • Updated JavaScript resource generation handler
  • Update online Web Resource Editor
  • NuGet Package

Database Resources?

A lot of times when I mention Database resources for localization I get: “Isn’t that really slow?” The answer to that is – nope, not really. Yes, resources *are* loaded from a database, but they are loaded only once per ResourceSet per locale. This means once resources are loaded and in memory, they stay there – the process is identical to using Resx resources except that the initial read of a resource set is done from a database rather than from assembly ResX resources. So while there’s a small db hit for first time resource load on each ResourceSet, over the lifetime of an ASP.NET/.NET application there’s not a significant performance difference.

Additionally this library has the ability to import and export resources from Resx resources, so you can pull in existing resources, edit them in the database while your application is in development, then when complete export the resources back out to Resx and use them that way. You can even generate strongly typed resources that work with either database or Resx resources simply by switching the ASP.NET ResourceProvider. However, I’ve found although a number of clients had the intention of doing this, they actually preferred running with the Db resources because it allowed them to change the resources on the fly in the application as needed, without having to recompile the app.

Database resources are incredibly useful in localized applications as it’s much easier to modify resources interactively. This resource provider includes an interactive ASP.NET Web based resource editor that allows editing and updating of resources in a running application. The ability to manage resources interactively and update them however, adds a ton of flexibility which is a big sticking point in many a localized application I’ve worked on in the past.

Additionally if you use this provider, it has the optional capability to automatically add new resource keys to the database as keys are accessed. So if you use a resource that doesn’t exist, the value of the key is used, but also the key can automatically be added to the database. You can then lookup all missing ‘values’ and localize those.

DbResource Provider Support

The DbResourceProvider works with standard ASP.NET localization schemes so everything that works with ResX resources also works with the database provider. The DbResourceManager also works in any .NET application including services, console apps and even desktop applications.

All of the following are supported in ASP.NET:

  • DbRes Helper (part of Westwind.Globalization)
    Say Hello: @DbRes.T("HelloWorld", "Resources")
  • HttpContext.GetGlobalResourceObject()
    Say Hello: @HttpContext.GetGlobalResourceObject("Resources", "HelloWorld")
  • Page.GetLocalResourceObject() (WebForms only)
    Say Hello: <%= GetLocalResourceObject("lblHelloWorldLabel.Text") %>
  • WebForms Control meta:resource tags (WebForms only)
    <asp:Label ID="lblHelloLabel" runat="server" meta:resourcekey="lblHelloWorldLabel"></asp:Label>
  • WebForms Control Resource expressions (WebForms only)
    <asp:Label ID="Label1" runat="server" Text="<%$ Resources:Resources,HelloWorld %>"></asp:Label>
  • You can also generate strongly typed resources (once generated)
    Say Hello: @Resources.Helloworld

Alternate Localization Scheme

ASP.NET localization is based on ResourceID localization. The idea is that you have a resource ID value and that value is then matched in a ResX file for each of the locales you want to localize for. Typically using this approach you create keys that are more like Ids, rather than values, which in a lot of ways can be limiting.

More and more customers I’ve worked with though prefer using direct translation – ie. rather than embedding resource Ids, they want to embed actual resource string values in the default language and then translate those values later.

For example imagine I have a resource embedded like this in an MVC application:

<legend>@DbRes.T("Your Details","Account")</legend>
<label>@DbRes.T("First Name")</label>
@Html.TextBoxFor(mdl => mdl.User.FirstName, 
new { @class = "input-block-level", placeholder = DbRes.T("First Name") }) <label>@DbRes.T("Last Name","Account")</label> @Html.TextBoxFor(mdl => mdl.User.LastName,
new { @class = "input-block-level", placeholder = DbRes.T("Last Name") })

For example Last Name is a Resource Id here, which is the default text used. Even if there’s no resource named "Last Name" in the resource set, Last Name will be returned. Later when you translate to other languages those values can then be added and the translated values will be returned instead.

DbRes.T(resourceid,resourceSet,localeId) for translate is a small helper method directly accesses the Db Resource manager to retrieve values and it’s an easy way to use the

Unlike the standard ASP.NET ResourceProvider and ResourceManager, DbRes.T() and also the ASP.NET DbResourceProvider and DbResourceManager all automatically return the resource key if the resource Id was not found, so that when there’s no match at the very least you get the resource key value, rather than an empty string which sucks! If you’ve ever loaded an application with missing ResX resources you know what I’m talking about – it’s no fun to have empty labels and buttons and other UI controls without any content :-) This ResourceProvider will always return something…

Using actual translated default values for ResourceIds makes it easy to get default content into a page.

Further, If I add

addMissingResources="true" 

to the provider configuration resources are automatically added if they are not found. This adds resources in the Resource Editor for easy later translation simply by running the app rather than having to manually add the resources.

This works surprisingly well as resources are added to the application as you run it and you access the actual values on pages.

There is a caveat here however, if you change a resource string in your markup you potentially break the link to your resources in the database. So you have to be aware to either leave the original resource key intact and add an actual default text value, or you can rename the resource name in the Web editor which is actually very easy (advantage database :-)).

Although I was resistant to work with this approach initially I’ve come to appreciate how easy it is to work with this setup. You get default resources always, and with keys added automatically you can easily localize and add new language later. The database manager also includes a method to cleanup resources that have entries with null values and no localization, so when you’re done localizing you can clear out any clutter in the db of resource values that don’t have any actual translated data.

Anyway – it’s something to consider when setting up a new localization project.

Check it out

If you are doing localization in your application and you’re looking to do it a little more dynamically then what you can do with Resx, check out the database resource provider described here. It’s easy to get started and it provides a ton of flexibility to get resources added easily interactively or under program control.

Resources

© Rick Strahl, West Wind Technologies, 2005-2014
Posted in ASP.NET  Localization  

by Rick Strahl at April 01, 2014 12:53 AM

March 31, 2014

FoxCentral News

Westwind.Globalization .NET Library Updated and Video Added

 The Westwind.Globalization library is a database driven localization provider for .NET that allows you to use resources stored in a Sql Server database with the .NET Resource Provider and Manager system. The library provides a custom ASP.NET ResourceProvider and standard .NET ResourceManager to access resources. A number of helpers greatly facilitate localization option including strongly typed resources, serving of .NET resources to JavaScript clients and a rich editing UI for adding and editing resources interactively. This library is free and source code is available on Github. A new Getting Started video has been created to facilitate integration into your applications.

by West Wind Technologies at March 31, 2014 11:22 AM

www.atoutfox.org - Contributions

PostgreSQL : accès aux données et procédures stockées

Bonjour

Voici le contenu complet de la présentation initialement intitulée "Développement de procédures stockées et triggers", et qui n'a pas été terminée lors des rencontres.

Luc

by Luc at March 31, 2014 05:16 AM

Sandstorm's Blog (Home of ssClasses)

Highlighting Pageframe ActivePage

Aesthetics is something that always fall to individual tastes. Some wanted their app to simply follow the OS theme, others want it to look plain, yet others like me wants to make it a bit colorful or somewhat unique thinking it will spice up the app.

However, sometimes we tend to overdo the look.  For example, in the past I tend to create a pageframe with several pages each having its own colors (theme should be set to .F. otherwise the color will be ignored). In the first glance, things look cool to my taste but then in the end either I simply turn the theme back on because I get tired of the multitude of colors or I just retain one color for all pages with theme still set to .F.



But then, I thought we can play a bit with a colored page of a pageframe by making only the active page different in color.  The purpose is to make it simpler yet with added effect, i.e., a page changes to the selected color while the rest goes back to the standard one. This serves as a sort of beacon or a way of highlighting a pageframe's active page.  See images below to picture what I am talking about:


The trick is simple, so if you are interested to have the same, just see the sample codes.  Cheers!

Public oFrm
oFrm=Createobject("MyForm")
oFrm.Show()

Define Class MyForm As Form
      AutoCenter = .T.
      Width = 400
      Height = 140
      Caption = 'Page Highlighter'
      Add Object PgFrame1 As MyPageFrame
Enddefine

Define Class MyPageFrame As PageFrame
      PageCount=0
      Top = 10
      Left = 10
      Height = 120
      Themes = .F.
      TabStyle = 1

      Add Object Page1 As MyPage
      Add Object Page2 As MyPage
      Add Object Page3 As MyPage
      Add Object Page4 As MyPage
      Add Object Page5 As MyPage
      Add Object Page6 As MyPage
Enddefine

Define Class MyPage As Page
      Procedure Activate
            This.Parent.SetAll('Backcolor',Rgb(236,233,216),'MyPage')
            This.BackColor = Rgb(191,223,255)
      Endproc

Enddefine


by Jun Tangunan (noreply@blogger.com) at March 31, 2014 03:31 AM

March 30, 2014

www.atoutfox.org - Contributions

Coder proprement

Coder proprement, ce n'est pas être le meilleur programmeur, c'est avant tout d'appliquer certains principes simples pour que le code soit lisible par d'autres que nous mêmes. Et le gain est réel et immmédiat.

by jcriv at March 30, 2014 05:16 AM

Alex Feldstein

March 29, 2014

www.atoutfox.org - Contributions

Comparatif langage VFP vs JAVA

Matériel de la session "VFP vs Java" des rencontres 2014 à Lille

Découverte du langage Java par un développeur Visual FoxPro.
Comparaison des analogies et des différences.
Peut-on faire en Java ce que l'on fait en VFP ?

by Francis Faure at March 29, 2014 05:16 AM

Continuous Integration

Le materiel de la session

Aussi lire une traduction du texte de Martin Fowler
http://skalp.developpez.com/traductions/martin-fowler-integration-continue/

by Gregory Adam at March 29, 2014 05:16 AM

Alex Feldstein

Photo of the Day


VW arriving to the Dream Car Classics show in Hollywood, Florida

by Alex Feldstein (noreply@blogger.com) at March 29, 2014 05:00 AM