Pages

Friday, April 29, 2011

This blog has been moved

Due some technical problems, I decided to move this blog to new address at

http://powerbuilderworld.blogspot.com

This blog will still exist, but for the new post will be posted at new blog address above.

Thank you
»»  READMORE...

Thursday, April 28, 2011

Create Object Programmatically with Powerbuilder - Part 1

In Powerbuilder, we can create an object programmatically, means that you can create whenever you need or conditionally.

In this first part, I trying to explain how to create "static" picture object when user clicking the button. Static mean that we only create the object, without script associated inside the object. The function that will be used it's called: openuserobject

For detail explanation of openuserobject function, please see the official help of Powerbuilder. 

First, create a button, and type this follow script inside Clicked event.
picture p_2  // declare the picture variable
p_2 = create picture  // create the picture object

p_2.x = 100  // x position of the object
p_2.y = 100  // y position of the object
p_2.height = 250 // height value of the object
p_2.width = 250 // with value of the object
p_2.picturename = "redalert.bmp" // name of the picture inc full path

parent.openuserobject( p_2, "p_2", 100, 100) // ok, let's create the object


»»  READMORE...

Wednesday, April 27, 2011

Click and Drag with Powerbuilder

This article will show you how to make an object to be click and drag capable in Powerbuilder. In this case, I'm using Powerbuilder 9.0 and Picture Object. In this version, I found DragAuto property in the list of the picture property, one that I can't found in version 6.5. I'm not sure, since when Sybase added this property.

The Drag Auto property determines whether PowerBuilder puts the control into drag mode automatically. If the property is enabled, when the user clicks the control and starts dragging it, PowerBuilder puts the control in drag mode. Clicking the control triggers a DragDrop event, not a Clicked event.

If Drag Auto is not enabled, then when the user clicks the control, PowerBuilder does not put the control in drag mode. You have to call the Drag function to put the control into drag mode.

In the Window, put 1 Picture object, and set the name of the file, and turn on the DragAuto option, in other tabs of property, and named it as p_1


Add the following script in p_1's clicked event
this.Drag(begin!)

At the p_1's dragleave event, put this following script:
this.x = parent.pointerx( ) - (this.width / 2)
this.y = parent.pointery( ) - (this.height / 2)
parent.setredraw(true)
this.setredraw(true)

And finally, at p_1's dragdrop event, add this following script:
parent.setredraw(true)
this.setredraw(true)
this.Drag(end!)
»»  READMORE...

Thursday, February 10, 2011

Printing shrink in IE7 and IE8

Some of my users facing the font shrink-ed when they tried to print the web page with Internet Explorer (IE) version 7 or 8.

To solve this case, if you are using version 8, make sure the option Shrink to Fit option in Page Setup menu, in your IE, is unchecked.

If you are using Internet Explorer version 7, you need to add the Registry Key by doing the steps below:
On the command prompt, type the following statement:

reg add "HKLM\SOFTWARE\Microsoft\Internet Explorer\MAIN\FeatureControl\FEATURE_STF_Scale_Min" /v iexplorer.exe /t REG_DWORD /d 100 /f

Click OK to confirm when warning window is showed.

Or, download this file, unzip the file, then run the file inside.
»»  READMORE...

Thursday, January 20, 2011

Toshiba Satellite Pro L640 Review


Toshiba Satellite Pro L640 deliberately designed to run faster than any other Satellite series. 14-inch wide-screen support the easy mobility of users. No doubt Notebook Toshiba Satellite Pro L640 in circles like the design for students and professionals.Again, an interesting texture to be lethal for young people. 
Point of Review :
  • DDR3 support makes Satellite Pro L640 deliver more bandwidth and more energy efficient. In addition, the 14-inch diagonal TruBrite HD LED-backlit display is really evocative of your eyes. Brighter, sharper, and claimed to be more energy efficient.
  • Touchpad with Multi-touch Control in the Toshiba Satellite Pro L640 makes the process of zooming an image or whatever is easier and faster. Very fitting for a worker designer or photographer who spent more than half a day in front of a computer for image processing graphics.
  • Connect anywhere with the Wireless N Wi-Fi with this notebook. A busy professional and student really need this connection. In addition to checking email, social networking can be a separate way to keep in touch with friends
  • Finding  files in a notebook folder tucked sometimes hard sometimes quite annoying. Especially when the folder-folder has been disordered. Satellite pro l640 answer with ToshibaReelTime ™. With this notebook application you can search files in various ways. Start typing afilename from the direct or first grouping based on file type. Facilitate it?
Satellite Pro L640 is enough cover anything that needed a professional and student . Mobility, busy schedules, the need for internet connection. Everything can be resolved with this notebook. Size is not too high price with quality is a gift for qualified professionals and student.

Allegories are circulating in the community that Toshiba Notebook as a tank is separate evidencethat the Satellite Pro L640 notebook is worthy of your purchase.
»»  READMORE...

Nintendo 3DS Software Estimated Price


Since Nintendo hasn't given any official word on this subject yet, Joystiq was kind enough to look into retailer price listings for 3DS software. From what we're seeing, it looks like anywhere from $40-50 a pop for a 3DS game card - or in other words games priced at relatively the same cost as Wii games. Now, considering we're getting more for our money, this certainly isn't surprising, but with game prices climbing this high it's hard to say that handheld gaming is shaping up to continue to be the affordable alternative to consoles.

Read more at here
»»  READMORE...

Friday, January 14, 2011

[Updated] Toshiba Folio AS100 Short Review

My last post about Toshiba Folio AS100 review said that the camera quality is poor. Now I want to make a correction that the camera quality is fair for 1,3 MB resolution. All because my boss put the screen protector which block the webcam.

When I tried to remove the screen protector, the camera work well with the fair quality.

Also I have more times to try the Folio. Since the Toshiba doesn't provide the Android Market application yet (confirmed by the Toshiba, but they said they will launch the Android Market for the Folio somewhere in January 2011), you can try to download the applications with the 3rd party applications like Camangi Market or via pandaapp.com

I've tried to install some games and Youtube viewer, some of them work well, some are not.
»»  READMORE...

Friday, January 7, 2011

AVG 2011 Offline Full Installation Download

As the default, when you want to download the AVG 2011 free version, you only download the basic installation file, then you must have the internet connection to continue to finish the installation.

Some times you have another computers (PC / Notebook), which have no internet connection. How to install the AVG 2011 antivirus to the offline computers ?

Just download the offline full installation file from http://free.avg.com/in-en/download.prd-afh, then install it into each offline computers. The installation is for Windows XP, Vista, and Windows 7, both for 32 or 64 bits. And also you can find the newest updates of AVG 2011 in the link.
»»  READMORE...

Thursday, January 6, 2011

Toshiba Folio AS100 Android Tablet - Short Review

Just got Toshiba Folio AS100 from my boss, the first Android tablet from Toshiba.

First impression, it quite good design compared to another tablets. I only have around half hour to try the Folio


The weight is light, according to Toshiba's website, officially they said is around 760 gr, is more light than iPad. From the dimension, is not quite far from iPad. The different is the type of the screen which is the Folio come with wide screen mode.



The touch screen is more sensitive than the other android tablet product, specially if compared with the china's android tablet market. But still below the iPad technology.



One of the main disadvantage from Folio is there's no Android Market Application. That's made me difficult to try to download the application from officially.
Another weakness is camera quality. Even come with the 1.3 MP resolution, but still the result is very poor.


Officially, the main specs of Toshiba Folio AS100 is:
  • OS: Android 2.2
  • Processor: Nvidia Tegra 2
  • Display: multitouch display 10.1 "widescreen WSVGA (1024x600pixel)
  • Audio: 2 stereo speakers and microphone 0.5 W
  • Storage: 16GB internal memory
  • Networking: 802.11b/g/n WiFi, Bluetooth, 3G
  • Ports: HDMI, USB 2.0 standard, USB 2.0 mini audio jack
  • Card reader: SD (up to 32GB) MMC
  • Battery: 1020mAh, 3.7V, 22600mWh. Up to 7 hours of life with mixed use
  • Internet: Opera Mobile Browser with Flash 1.10
  • Productivity suite of office applications, PDF reader, ebook reader and RSS aggregator
  • Multimedia: 1.3 MP Webcam
  • Dimensions: 281 x 181 x 14mm
  • Weight: 760gr
»»  READMORE...

Motorola Xoom

Motorola has just outed its delicious Honeycomb tablet alongside another device, the LTE-equipped Bionic, on its official site.  A 1GHz dual-core Tegra 2 offers the power from within, and 4G connectivity will apparently be available as an update in Q2 following a Q1 launch. Other specs include a 1280 x 800 resolution, 5 megapixel camera, 720p video recording and 1080p video playback, 802.11n WiFi, Bluetooth 2.1 + EDR, and finally, a healthy 32GB of onboard storage.
»»  READMORE...

Tuesday, December 21, 2010

Sending email with Powerbuilder

Several months ago, I posted the article which explain how to create Outlook Calendar Appointment with Powerbuilder. One of the reader asked me to how if  we want to send an email with Powerbuilder via Microsoft Outlook.

Well, several years ago, I wrote this PBL which have a window inside that can read the Address Book of Microsoft Outlook, and put as the recipients and send the email via Microsoft Outlook. Since I am not using Microsoft Outlook anymore, I don't know it will be run smoothly or not in Outlook version 2007 or 2010.

You can download it by clicking here
»»  READMORE...

New features in Powerbuilder 12.1

In 21 Sept 2010, Sybase launched the EBF for Powerbuilder version 12 with 12.1 as the minor version.

According to PowerbuilderTV.Com, there are some new features in version 12.1 such :

  • XAML Editor Enhancements
  • 3rd Party Control Support
  • OLE Control Support in WPF Application
  • WPF DW RightToLeft Enhancements

But still there are some limitations like
  • No support for dynamically creating OLE controls in PowerScript
  • No support for saving and retrieving the structure storage of an OLE control
  • Must install .NET framework SDK 2.0 or later before you migrate OLE controls to WPF
For detail, visit this link to see the complete video. The duration is about 40 minutes. And you can download the version 12.1 EBF file from Sybase official download site
»»  READMORE...

Wednesday, December 15, 2010

Webcast: Powering the Future with PowerBuilder 12

PowerbuilderTV (http://twitter.com/#!/PowerBuilderTV) release they tweet about webcast with subject Powering the Future with Powerbuilder 12, last night. This webcast is sponsored by Sybase and will be held Tuesday, December 14, 2010, 10:00 am PST / 1:00 pm EST.

Check out the detail at this link
»»  READMORE...

Friday, December 10, 2010

Set Local Computer Time with Powerbuilder

With External Function feature, we can set the Local Computer's time with Powerbuilder.

First, we need to declare the external function, called SetLocalTime from kernel32.dll

FUNCTION long SetLocalTime(ref str_SYSTEMTIME lpSystemTime ) LIBRARY "kernel32.dll" alias for "SetLocalTimeA"

To use the function, just pass a datetime variable when you call the function.

Example:

DataTime dtToday
dtToday = DateTime(Today(),Now())
SetLocalTime(dtToday)

»»  READMORE...

Wednesday, December 1, 2010

Integer versus Long Data Type in Powerbuilder

When you have an INTEGER column type in a table on your database, you must be aware to script in Powerscript.

The Integer data type in Powerbuilder just have the 16-bit signed characteristic, which mean only can store the integer number between -32768 to +32767. It's totally different with the Integer data type in your SQL database engine. I'm talking about Ms. SQL Server 2000/2005 in this case.

Make sure always using LONG data type in your variable, instead of INTEGER, to prevent the value outside -32768 or +32767.

For example, if the value of the column in your database is 34000, you'll get an error if you store the value into the integer variable on your script.
»»  READMORE...

Sunday, November 21, 2010

Error code 80710723 on Playstation 3

I have personal experience with this error when I tried to access Playstation Home. I always got 80710723 error when I tried to download the newest version of software. I'm using Linksys Wireless Router WRTG54 as my internet connection, connected via wireless to my PS3.

To resolve this error, you must disable UPnP feature in Management page. UPnP is used by certain programs to automatically open ports for communication.

»»  READMORE...

Sunday, November 7, 2010

Nikon Capture NX2

For all of you who has Nikon camera, such Nikon SLR D3000, Nikon Capture NX2 is a must have software to manage the result photos from the camera. The latest version is 2.2.6 which can download for the trial version at http://nikonimglib.com/cnx2/.

Nikon Capture NX2 is easy to use new generation of software for processing and editing images. Through the use of technology exclusive U Point, the program includes a set of powerful tools and four fully customizable workspaces with the ability to save and switch between them to ensure fast and efficient workflow. With simple and intuitive operation interface, no need to concentrate on working with tone and color, allowing you to develop an image in accordance with the classical principles of focusing and the allocation of certain interest to the photographer of an image. This program can be used to manipulate images in JPEG and TIFF any source, it represents the best product for editing Nikon NEF.

Application has a powerful functional and a lot of opportunities. According to the developers of Nikon, photographers can now spend more time in the process of shooting and less processing. The application allows photographers, regardless of their experience, to quickly edit all the basic image parameters such as brightness, contrast, saturation, warmth, and more. Moreover, the operation can be carried out, as over the whole image, and above its individual elements, which eliminates the photographer from having to use complex selection or masking during processing. One of the main features of the program Capture NX2 is a unique technology of U Point, which allows operation with the image selectively.

Technology U Point, used in this program provides a discreet, intelligent support, expanding a comprehensive set of tools for image correction. U-Point technology provides easy selection of interest to the photographer of an image with an intuitive, easy adjustment of brightness, contrast and saturation, the function of effective suppression of unwanted red-eye and fine-tune the color balance. Simply click the area you need to edit and adjust the sliders for the opportunity to instantly see the effect of corrections made.

Key features:
  • Technology U-PointTM, provides comfortable selecting areas of interest image
  • Tool Auto Retouch Brush, which allows accurate and convenient removal of unwanted items
  • Mode Quick Fix, brings together the most frequently used tools in a single window
  • Ability to work on two monitors and a fully customizable workspaces
  • Tool Selection Control Point, which lets you conveniently to improve the perception of image sharpness
  • Enhanced management of images

Redesigned Interface includes:
  • Customized Workspaces
  • Improved Toolbar function and layout
  • Improved Edit List functionality
  • Newly designed image browser featuring a Favorites Folder
  • Improved Image Resolution adjustments
»»  READMORE...

Monday, November 1, 2010

Powerbuilder Window Function

On my last post about Powerbuilder function, I have mention that there are 2 types of function in Powerbuilder. Now, I will try to explain another function called Window Function.

The main different between Window Function and function, is Window Function must be declared in Window Object, and it should be related with windows object inside.

The way to declare the Window function is almost the same when you declare the function. But for the first step, you need to open your window first, where you want to put the window function inside. Click Declare at drop down menu, then select Windows Functions sub menu.



Specify the name of the function, the arguments, the return value and specify where the function can be used: Public (in any script in the application), Private (only in scripts for events in the object in which the function is defined), or Protected (only in scripts for the object in which the function is defined and its descendants).


Type the script, then save and name wf_datechecked. The script will compare the 2 variables (one is the argument, one is the today's date)

// sample window function, named wf_datechecked
// argument or parameter is dtDateTransaction
// will return TRUE if comparation between dtDateTransaction is smaller than dtToday
// will return FALSE if comparation between dtDateTransaction is bigger or equal than dtToday


DateTime dtToday

dtToday = DateTime(Today(),Now())

If dtDateTransaction >= dtToday THEN
   RETURN FALSE
ELSE
   RETURN TRUE
END IF


To call the function, type script below (on Clicked event of b_checked, for example)
Assumed that you have datawindow called dw_1, and has column inside name dateofbirth.

Boolean bValidDate

bValidDate = wf_datechecked(dw_1.GetItemDateTime(row,"dateofbirth"))

IF bValidDate THEN
   Messagebox("Information","The Date is valid")
ELSE
   Messagebox("Information!","The Date is invalid. You must input the date smaller than today")
END IF
»»  READMORE...

Thursday, October 28, 2010

Powerbuilder Function

In every modern programming languages, there is a feature call FUNCTION, as well as Powerbuilder.

FUNCTION is a collection of scripts or statment which it can be re-used. Normally, FUNCTION has a return value.

In Powerbuilder, there are 2 types of FUNCTION: Function and Window Function. The different is FUNCTION can be use anywhere in object that has capabilities to call function, but Window Function just can called in the window itself.

In this article, I will show you the steps how to declare the function in Powerbuilder. I'm using Powerbuilder version 6.5 and I'm sure it will be the same for all versions above

In the main toolbar, click Function painter.


Click New to create a new Function


Type the name of the function, in the example: f_yearafter
Also specify the type of return variable, in this example: date
Function can has many parameters. Parameters can used to passing some value(s) into function, so later can be used to process or calculate something in the script of function. Beside the name of parameters, you must specify the type of parameters, and the Pass By. There are 3 types of Pass by: value, reference, and readonly. Use reference if you want to change the value parameter then inside the function script.
Click OK to create.


Now you can type the script inside the.
In this example, we create a function call f_yearafter. The function will return a date type value, which it is the date result after some year added.

Once the function created, you can't change or rename the function name, but you can still change the return value, the parameter, etc. Please pay the attention, changing all of that value, will affect into the script inside the function. You can click the function painter icon in the toolbar, to edit the function



To call the function, just add the script like this:

Date dReturnFunction

//add 2 years for the date
dReturnFunction = f_yearafter("01/01/2008",2) // will return "01/01/2010"

»»  READMORE...

Monday, October 25, 2010

Unlock SA login in Microsoft SQL Server

If you or your team members who has access to your Microsoft SQL Server database with SA login, did type the wrong password three times, normally the SA login will be locked. It should be an error :

Login failed for 'sa' because the account is currently locked out. The system administrator can unlock it.

To solve this problem, you need an authority to access the database server directly. Login with the administrator login name, then open Microsoft SQL Server Management Studio. Choose Windows Authentication mode, then click Connect.



Now, in Query windows type this statement then execute

ALTER LOGIN sa WITH PASSWORD = 'sa_password' UNLOCK


There's an option to avoid the sa login to be locked forever, just go to Security, Logins, sa, Properties, then uncheck Enforce password policy option.
»»  READMORE...