Archive for the ‘Uncategorized’ Category
Although we have the online documents for ForeUI, many new users still wish to have more detailed tutorial. Today I will create a (working) icon search engine with ForeUI, and I believe it will be very interesting! I will give the icon search engine a cool name: ICOOGLE. It is a combination of two words: “Icon” and “Google”
Create the GUI
There will be two pages to create:
- Home page that allows user to input parameters for searching.
- Result page that display the current page of results. This page can also accept user’s new search request.
Create a new plot, and set its page size to 1000×750, via the “Plot Settings…” button on the bottom right corner. Now we are editing the first page (home page).
Drag a Text Box (text label) element from the element list on the left, and drop it into the page. Double click the Text Box and change its content to “ICOOGLE”, set its font size to 65, use bold font, change text color to light blue, set elements size to 350×70, vertically and horizontally center the content, and move element to (325, 200). This will be the logo, as shown below:
Drag another Text Box, a Text Edit Box and a Button element into the page, set their font size to 16, and set their height to 28, then align them in the same line, and put them in under the logo. Here is how the home page looks like:
It will be better to rename the elements with some meaningful ids, so we can easily find them when defining the behavior. Don’t forget to group the “Search Icon” label, the Text Edit Box and the “Search” button together, this will help us to reuse it in the second page (using Reference). Open the outline view by clicking the “Outline” button on the left bar, you should see the outline like this:
Click the button at the bottom to open the page management view, set the current page title (on the right of the view) to “Home Page”. Click the button to add a new page, and set its title to “Results”. The newly created page will be selected automatically, so now we can edit its content.
Now we are goint to make use of the Reference element. The Reference element is quite special: it can simulate the look and functionality of another element (which is called “reference target”), this can help us to reuse the previously defined elements to build new content.
Once you see this window, you can browse to any page to pick the element you want, as the reference target. Here I will choose the logo text box, because I will also need the logo in the result page.
Adding another Reference element into the page, and set its target to the group we created before (so it will emulate the entire searching function block, fancy ). Rearrange the position of these two references and adding a horizontal Line element to finish the header of the result page:
The results page will display 10 results per page, each result will be displayed in an iFrame element. So we need to create 10 iFrame elements, set there default size to 64×64, and layout them in two rows (5 elements for each row). You can make use of the alignment buttons () and layout buttons () in the tool pane to do it quickly. Could not find these buttons? Try to select 2 or 3 elements together to show them
Finally, we add two Button elements and one Text Box element to create the pagination bar on the bottom.
Prepare for the API Calling
As I said, I will create a working icon search engine with ForeUI. I could achieve it thanks to the possibility that ForeUI could talk to the web service via JSONP API.
In this example, I will use the JSONP API provided by IconFinder. You can find more details about this API here. In order to use the API, you will need to sign up on IconFinder and get your own API key. For testing purpose, you could temporarily use our API key (8b3d4114b9994b188cef5bcef9765444).
The API will return a JSON object like this:
That means we can get total results number (the “totalResults” field) and all icons’ information (the “icons” array field) from the JSON object, which can make ICOOGLE functional.
Define the Behavior
Behavior definition is very interesting, and could be challenging in some cases. Since ForeUI allows you to define behavior in a simple and direct way, you don’t have to be a programmer. However it will be better if you could think like a programmer, since that will help you to make neat design of the behavior.
First we need to define a custom property to store the current page. We will include this property value in the URL for calling the API. The custom property can be defined in the custom property view, which can be opened by clicking the “Custom Property” button in the right bar.
The main logic of this web application is to call the JSON API and retrieve the icons’ URLs. We will need to call the API when:
- User click the “Search” button in the home page.
- User click the “Previous 10 Results” button in the results page.
- User click the “Next 10 Results” button in the results page.
We can let these three cases to share the same behavior, with different parameter (the page index and searching keyword). So I defined a global custom event and put the searching logic into its handler. This is very similar with the “function” concept in programing world: Three buttons will call this “function” to do the searching.
As you can see I define this “Do_Searching” custom event for the home page. Since it is a global event, it could be triggered in any place, so it is not a must to define it in the home page. The most important part is the “Get JSON” action. It should be defined like this:
The actual value of the URL is:
You can see the keyword and the page index is included in the URL. This API call will return a JSON object, which will be assigned to a custom property named “result”. That means, when the Get JSON action finished, we will have a custom property (with “object” type) that includes all needed information for showing the result.
As you can see, there are two actions to trigger another two custom events (line 4 and line 5): Update_Result_List and Update_Pagination_Info. It is not a must to define these two custom events, since you can put their logic into the Do_Search event handler. The reason that I do so is to make the structure more clean. The triggering of another custom event is quite similar with the “function call” in the programing world. The final step is go to the results page, using the “Go to Page” action (line 6).
Here is how the “Update_Result_List” event handler looks like:
It is just getting the icon URLs from the “result” object, and assign them to the iFrame elements (so you will see the icon in results page). Keep in mind that arrays in ForeUI is 1-based, so first member in array is array.
And here is the “Update_Pagination_Info” event handler:
So far we have define the main logic of searching, but no one is using it yet! We need to handle the “Element Clicked” event for all the three buttons and trigger the “Do_Search” custom event in the event handlers.
It is very easy to understand what they do: set the “startPage” property before doing the search, then we will get different results.
Now we have define the basic behavior of the web application. You can run the simulation, input a keyword, press “search” button, and you will see the icons listed in the results page, you can even switch pages.
Could you believe that? We have not defined any behavior for the search box in the results page, but it is working fine! That is the magic of the Reference element
Make It Even Better
ICOOGLE is working, but it is not good enough. Here are some disadvantages:
- Can not press ENTER to start searching
- No limitation to the “Previous” and “Next” buttons (could go to unreasonable page that has no result at all)
- Icon border does not match the icon size
- The icon list should be cleared before listing the result, otherwise the icon from previous searching may be kept in the result page.
In order to start searching after pressing ENTER, you will need to handle the “Key Up” or “Key Down” event for the Text Edit Box element, and check the CURRENT_KEY_CODE system property value. If the value is 13 (the code for ENTER key), we will execute the same logic with the “Search” button. PS: all possible system properties are listed in the system property view, which can be opened by clicking the “System Property” button on the right bar.
Also I modified the “Update_Pagination_Info” event handler a little bit to enable/disable the “Previous” and “Next” buttons according to the current showing range: if the first listing result is less than or equals to 1, the “Previous” button will be disabled; if the last showing listing result is larger than or equals to the total number of results. The “Next” button will be disabled.
The icon border is actually from the iFrame element, so we will need to resize the iFrame element according to the actual icon size (reserve 20 pixels as padding).
Simply set the source URL of the iFrame element to “about:blank” will clear its content.
Here is the final view of ICOOGLE:
This is a really long post. I hope you enjoy it
I’d like to use this tutorial to show what can be done with ForeUI, and attract more and more users to try the advanced features in ForeUI.
PS: ForeUI is still a prototyping tool, although it could be used to create the frontend of real web application. You can just use the basic features to create fast prototyes of your web site or software. If you wish to get higher fidelity of the simulation or even use it in production, ForeUI is ready for that.
Dear ForeUI customers, if your license key is older than one year, you can now renew your license with 50% discount (based on the price after applying the volume discount)
Here is the URL that will give you the details and instructions:
Remarks: to ForeUI V1, V2 customers who have purchased license key for ForeUI V3 with full price, you are eligible to get FREE license key that will cover the software upgrade for another year. Please write to firstname.lastname@example.org with both of your license keys (one for V3, the other for older version), and we will process your case manually. Thank you.
Dear all, Christmas and new year is coming. I’d like to represent the entire ForeUI team to wish happiness to you: Merry Christmas and Happy New Year!
During the last 10 days before Christmas, we offer 20% discount to everyone who are interested in buying ForeUI license. You can find more details here.
If you want to pay via RegNow, you can also use the “FOUI-I9FP-DISC” coupon to get the same discount.
We are going to enter the “lite” working mode. We may work less at the end of the year, but it is still a working mode, so do not hesitate to contact us if you have question/suggestion/comment in mind
ForeUI offers a powerful behavior engine, which allows you to define complex interaction in an elegant way for any GUI element on the screen. Sometimes you may want to run multiple tasks parallelly, which is also called “multi-threading” in the software industry. For example, assume we have a button, and we want to move it on right-down direction and enlarge it at the same time. Is it possible to do so in ForeUI? The answer is positive, that’s why I write this post
First let’s create a single-thread version for the example, so you can later compare it with the multi-threading version. The example only contains one button element (Button_1) and its behavior is defined as below:
There are two loops in the event handler for “Element Clicked” event: one for moving and one for resizing the button. I designedly use different looping parameters for them, so we have good reason that not to merge them into one loop. Since it is a single-thread version, it can only do the moving and resizing in sequence, like this:
Now lets try to make the multi-threading. The basic of the trick is that, the event triggering is not a blocking call. That means, when you trigger two events in order, the second event will not wait for the execution of event handler for the first event. As a non-blocking call, triggering an event takes almost no time, so the two events seems to be triggered at the same time, and their event handlers seems to be launched together.
So I changed the behavior for Button_1 as below. I added two “Element_Clicked” events to Button_1 and they will do moving and resizing accordingly. There are two warnings (highlighted with yellow) since we place the same event twice in one element. We know what we are doing, so just ignore these warnings.
Since the two loops are placed in different event handlers, they will be launched at (almost) the same time, thus you will see they are executed parallelly:
If you’d like to place the behavior definition in custom event handler, you can modify the example like this: (download this plot file)
If you don’t want to use global custom event, you can define it as the private event for Button_1, like this: (download this plot file)
The three examples above will work in the same way, you can choose the one you like when you want to do multi-threading in ForeUI.
The official release of ForeUI V3.0 is delivered today. Comparing with the previous releases, this version is more focus on the reliability and usability. However, there is still an exciting new feature in this version, which is called “integration task” that can easily integrate ForeUI with other tools.
You may already know that you can invoke ForeUI via command line to generate image or HTML5 simulation. However, have you considered to use other tools to process the file(s) generated by ForeUI? The integration task is designed for that purpose. In the settings window, you will see a new tab named “Integration”, which allows you to manage the integration tasks.
You can click the “Add Task…” button to add a new integration task. Here you can specify the parameters for the task.
If you unselect the “Task is Enabled” option, the new task will be created but not take effect immediately, until you enable it later.
If you select the “Blocking Subsequent Tasks” option, the new task will block the workflow until the command is finished. This is useful when you want to execute a serial of tasks in order.
You will need to specify the condition that trigger the task. So far ForeUI supports these conditions:
- Before Saving Plot
- After Saving Plot
- Before Export HTML5
- After Export HTML5
You can input or browse the command to be executed, and you can use the variables below in the command:
- %plot%: the file path of the current editing plot.
- %file%: the path of the output file. For Before/After Saving Plot task, it will be the path of plot file to save; For Before/After Export HTML5 task, it will be the path of generated HTML file.
- %dir%: the path of the output directory. For Before/After Saving Plot task, it will be the path of directory to save plot file; For Before/After Export HTML5 task, it will be the path of directory that store the generated HTML files.
By making use of the integration task, you can invoke other tools to process the file generated by ForeUI.
Example: Auto Commit Plot File to SVN Repository
Some customers have asked for the version control feature. Now we can have it by integrating ForeUI with SVN. If you are not familiar with the usage of SVN, you can find some tutorials via google.
Assume that you want to commit the plot file to SVN repository everytime after you save the plot. First you should add your plot file into a project, and checkout your project to a local directory. Then please open the plot with ForeUI and go to the “Integration” tab in settings window. You can create an integration task like this:
That’s all, every time you save your plot, it will be committed to the SVN repository, so you will never lose your work, theoretically
If the plot file is not added into your SVN project, the command above will do nothing.
Remarks: the integration task feature is available for registered user only.
Other Enhancements and Bug Fixings:
Please check out this page to see the complete list of enhancements and fixed bugs in this version.
We recently received some reports about not able to run ForeUI in Mac OS X 10.8 (Mountain Lion). When double clicking ForeUI icon, system pop up a message like this:
After checking, we realize the downloaded file was correct, and the reason that ForeUI can not run is the lack of code signing (with Apple developer certificate). It is a new feature of Mac OS X 10.8 (Mountain Lion), which is called “Gatekeeper”. You can find more details about Gatekeeper from Apple’s web site. In short, Gatekeeper just like an application firewall, and it will reject some application according to its security setting.
We believe the Gatekeeper will bring more security to user’s Mac, but it does bring us some trouble, since we don’t have the Apple developer certificate yet. Before we could release a code signed version of ForeUI, please use the following workaround to run ForeUI: (temporarily) allow applications downloaded from “Anywhere” before running ForeUI. The configuration can be made in the “Security & Privacy” panel, as shown below:
Hi everyone, I am glad to announce that ForeUI V2.75 is released today! This update is focus on enhancing the Accordion element, some enhancements to improve usability is made, and 3 bugs are fixed.
New Action and Properties for Accordion
We took the suggestion from Ben and add a new action named “Set Section Title”, which can change the Accordion’s section title dynamically. A new array property named “Section Titles” is available and now we can get the title text from certain section. An “Index of First Expanded Section” property is added to facilitate getting the current section for Accordion in “single expansion” mode. Below is an example to make use of all these new action and properties, you can also run its DHTML version in browser:
Some Enhancements on Usability
Now the tab for current editing plot will show the “x” button (close button) without mouse hovering, and you can close the current plot from the “File” menu. Thank David Mabelle’s suggestions for these via email.
We added a new option in the settings window, under the “Edit” tab, to turn on/off the instructional tooltips in ForeUI. What is instructional tooltip? It is the floating message as show below, which prompt the possible manipulation.
However it became kind of annoying to experienced users, so we provide the option to turn it off. Thank David Kjos’s suggestion for this.
- Bug_0297: When List/Menu/MenuBar/Tabs/VerticalTabs/Tree/ComboBox has no selected row, its “selectedIndex” property value should be 0 instead of -1 in simulation.
- Bug_0298: MenuBar with “Element Clicked” event handler meets error in simulation if “Selection Changed” event is not handled.
- Bug_0299: Embedded ComboBox has no selectedText property value until explicitly select an item.
Hello everyone, today we just released ForeUI V2.72! This version provides some new events, actions and properties.
New Actions and Properties for Table
We have implemented 3 new actions to append, insert or delete data row for the Table element, as shown below:
Also there are two new properties available for Table element:
What’s more, we made an enhancement on the “Table Cell Values” property, thus you can use variable (property) as the row or column index for the array. With all these new facilities, we could use Table element as data reposition, to read/write real data in the prototype. Thank Alan Finger’s suggestions on these.
Here is an example to make use of these facilities, you can also review it here:
New Event and Properties for Accordion
We added a new event named “Section Expanded/Collapsed” for the Accordion element. This event will be triggered when you clicked on the header of section and expand/collapse the section. Thank Tim’s suggestion on this.
What’s more, 2 new properties are available for Accordion. They are “Section Count” and “Section Expanded Flags”.
Using these newly added event and properties, you could find out which section is expanded or collapsed. The animation below is an example and you can also review it here:
“Note” Property for All Elements
Now with this new property, you can access the note for element during the simulation. This property exists in all elements. Thank Tim’s suggestion.
“Loaded as Master Page” Event for Pages
Any page can be used as master page. However the “Page Loaded” event will not be triggered if the page is just loaded as master page. So we add the “Load as Master Page” event for page. It will be triggered when the page is loaded as master page. Thank Tim’s suggestion.
- Bug_0295: Reduce the height of a table row and make it smaller than the default value, the change could not take effect in simulation.
- Bug_0296: When Table has no selected row, its “selectedIndex” property value should be 0 instead of -1 in simulation.
Hello everyone, ForeUI V2.70 is now available! This update brings you a brand new Accordion element and some other enhancements.
This element is requested by Jeffrey Werner about 1 year ago, Audrey Taylor and Tim have the same suggestion recently. We are so glad that we finally have this done.
The accordion element is actually a set of partly overlapped panels (sections), each panel has a header on top. Clicking on the header of panel will expand/collapse the panel thus the content in panel will be show/hide as well. It is a container element, so you can drag element into it with right mouse button hold.
There are many options for accordion element in the floating tool pane. The “Multiple Expansions” checkbox can control whether the element support multiple expanded section. You can specify the border color and the header background color, set the icons for collapsed/expanded sections etc. Here is a tips: if you like to use different icons on different sections, try dragging icon from image dock and drop to the header for sepcific section.
Here is an example for accordion element usage. There are two accordion elements in the plot. The accordion on the left supports multiple expansions, and it is simulating an expandable menu; The accordion on the right only allow single expansion, and it is simulating a set of sliding contact groups. This example is uploaded to the community site and can be reviewed here.
Enhanced “Set Table Cell Value” Action
From now on you could use properties (variables) in the row/column indices for “Set Table Cell Value” action. Thus you can use two text input boxes in prototype and accept the row and column indices input by user in the simulation.
- Bug_0286: For button with icon only, turn on the ‘underline’ decoration, then error happens and current action will halt.
- Bug_0287: If table’s actual row height is different than default value, the alternate color filling is incorrect in Hand Drawing, Windows XP and Windows 7 themes.
- Bug_0288: Hide the default icons for tree element, the icons are still visible in simulation.
- Bug_0289: Lock the position of the element and unselect it, the element become invisible if you drag it.
- Bug_0290: Can not directly click specific regions of element to change selection if zoom ratio is not 100%. (Tree, Table, Tabs, VerticalTabs and MultilevelMenu)
- Bug_0291: Hold SHIFT to resize element with aspect locked, the aspect is not accurate when any snap action is performed.
- Bug_0292: Select user-defined category in ‘Manage Category’ window, all buttons hover on element in the category are not clickable until restarting ForeUI.
- Bug_0293: Add custom element with duplicated name, should update its reference in the list instead of adding new reference.
- Bug_0294: In image dock, if the image ids are not sequential, dragging image to plot may not work correctly.
Hello everyone, we are back from vacation so it is time to roll out a new version
Comparing to previous updates, it one is not so big and it contains one new feature and three enhancements, as we need some time to warm up after the long vacation.
Input Note in Action Editor
This feature is scheduled for quite long time. It is very useful to explain the actions associated with element or page, just like the comments on source code.
In V2.67, when you open the action editor for element or page, you will see a new sub view on the right, which can list all notes for the actions.
To add or edit the note for entity, just choose the “Edit Note” item from the context menu, or just double click the row in the not view.
The note view is resizable and you can hide it by dragging it to rightmost border. The note can still be shown in the floating tooltip.
Multirow Note Editing
Now the note editing can support multirow, no matter for element’s note or action’s note. Just click the “Multirow Note” checkbox to toggle the single/multiple row modes.
- Allow selecting previous/next entity with UP/Down arrow in action editor.
- Show warnning message if the plot to load does not exist. (Thank Mario Gonzalez’s suggestion)