Profile

Sabtu, 26 Maret 2011

Check for open mdi child, with focus (C#)


This code snippet shows you how to check if is your MDI container has a specific MDI child open or not.
The sample below looks though each of the mdi children in the container for a instance of the form you want to open.If an instance is found, the form is brought to the front (focused).If an instance of the form is not found, the code opens a new instance of the form.

Snippet

private void CheckMdiChildren(Form form)
{
foreach (Form frm in this.MdiChildren)
{
if (frm.GetType() == form.GetType())
{
frm.Focus();
return;
}http://www.blogger.com/img/blank.gif
}

form.MdiParent = this;
form.Show();
}

Usage:
MyForm form = new MyForm();
CheckMdiChildren(form);



Senin, 24 Januari 2011

Handle Barcode Sacnner Input in Browser via jQuery

Handle Barcode Sacnner Input in Browser via jQuery

B/S(Browser/Server) architecture applications dominate the enterprise market. It is important to enable other input devices, such as barcode scanner(reader). This tutorial shows how to deal with barcode scanner in browser.

1. How does barcode scanner work ?
When you plug a barcode scanner into a comptuer, it will be recognized as an input device, similar as keyboard. Wherever you can input text via keyboard, so can barcode scanner. It can be understood as that, barcode scanner read text from a barcode tag, then type them one by one for you.

For example, suppose there is a barcode "1234". when you scan it with barcode scanner, it likes you type via keyboard,"1","2","3","4","ENTER". Yes, there will be a "enter" stroke which automatically added by scanner after it finished read the barcode.

2. Capture barcode in Action.
First of all, put a input filed to accept barcode:

input name="barcode" id="barcodeinput" type="text"

Then listen the keypress event, get the barcode value when there is a "enter" key stroke:


$("#barcodeinput").keypress(function(e){
//key code 13 is "enter",
if(e.keyCode==13){
//print out the barcode
alert($("#scaninput").val(););
//clear the input field for next scan
$("#scaninput").val('');
//kill the "enter" event
return false;
}
});



Notice:
Because the "enter" keystroke, IE will submit the form. To stop it, use "return false".



source: http://www.ke-cai.net/2009/06/handle-barcode-sacnner-input-in-browser.html

Kamis, 06 Januari 2011

Add currency indonesian rupiah

1. Login into admin panels
2. select Menu :System > Localisation >Currencies.
3. Click INSERT in Currency page
4. Input all data

Tutorial Membuat Toko Online dengan Opencart–Install bahasa indonesia

Setelah Selesai Instalasi Aplikasi Opencart, kemudian Login ke admin panel.
Selanjutya Download file modul bahasa indonesia di web resmi opencart.

Berikut langkah-langkah instalasinya:

1. Ekstrak file Language Indonesia.zip

2. Copy folder indonesia ke direktori catalog/language/

3. Login ke halaman admin.

4. Masuk ke menu System > Localisation > Languages.

5. Pada halaman Language, klik tombol Insert.

6. Masukan data-data sebagai berikut :

* Language Name: Indonesia
* Code: ID
* Locale: id_US.UTF-8,id_US,id-gb,indonesia
* Image: id.png
* Directory: indonesia
* Filename: indonesia
* Status: Enabled
* Sort Order: 1 atau 2
7. lanjut klik tombol Save.

8. Pada halaman catalog sudah terdapat pilihan bahasa Indonesia.

Selamat mencoba Good Luck...

Selasa, 21 Desember 2010

Bikin TCPDF font

Filed under: CentOS, Fedora, Joomla, LAMP, oscommerce, php, Tips, Tricks | Tags: create pdf with php, create php fonts, Create TCPDF PHP Fonts, pdfPHP, tcpdf fonts |

TCPDF supports TrueTypeUnicode (UTF-8 Unicode), OpenTypeUnicode, TrueType, OpenType, Type1, CID-0 and Core (standard) fonts.

You will find font creation utility at fonts/utils of TCPDF… copy desired font to fonts/utils/svnlabs.ttf

* For TrueTypeUnicode

# cd /var/www/html/tcpdf/fonts/utils

# ttf2ufm -a -F svnlabs.ttf

# php -q makefont.php svnlabs.ttf svnlabs.ufm

* For embedded fonts to tcpdf PDF file.. copy the resulting svnlabs.php, svnlabs.z and svnlabs.ctg.z to fonts folder

Uses:


……..

$pdf->SetFont(‘svnlabs’,'I’,8);

……….

?>

http://sandeepverma.wordpress.com/2009/12/10/create-tcpdf-php-fonts/