my dictionary - Google dictionary

HMG Samples and Enhancements

Moderator: Rathinagiri

Post Reply
User avatar
nguyenchiduc
Posts: 78
Joined: Sat Nov 13, 2010 7:27 am

my dictionary - Google dictionary

Post by nguyenchiduc »

dictionary database on the PC:
Name: dic.dbf
Two fields: dic->data, dic->translete
---------------------------------
Please create your own database and try to surf the Internet.
Use CTRL+C to copy, and ALT+TAB to view on Windows

Code: Select all

#include "hmg.ch"

Function Main
    /* use dic index dic alias dic SHARED NEW READONLY */
    DEFINE WINDOW Win AT 0,0 WIDTH 790 HEIGHT 200 TITLE 'DICTIONARY' MAIN 
       @ 10,10 LABEL data WIDTH	780 HEIGHT 80 VALUE ''
       @ 100,10 LABEL translete WIDTH 780 HEIGHT 80 VALUE ''
        DEFINE TIMER Timer_1 INTERVAL 1000 ACTION dictionary() 				
    END WINDOW

    ACTIVATE WINDOW Win
Return

FUNCTION dictionary()
   LOCAL value1 := '' , value2 := ''
	
   value1 := win.data.value
   value2 := System.Clipboard
   IF value1 <> value2
       Win.data.value := value2
       /*
        select dic
        seek alltrim(value2)
        IF FOUND()	 	   
            Win.translete.value := dic->translete
        ENDIF
       */
   ENDIF
	
RETURN
Image
User avatar
nguyenchiduc
Posts: 78
Joined: Sat Nov 13, 2010 7:27 am

GOOGLE DICTIONARY

Post by nguyenchiduc »

Code: Select all

#include "hmg.ch"

Function Main
   PUCBLIC value1 := ''
   DEFINE WINDOW Win AT 0,0 WIDTH 790 HEIGHT 500 TITLE 'GOOGLE DICTIONARY' MAIN 
       @ 10,10  ACTIVEX Test WIDTH 790  HEIGHT 480 PROGID "shell.explorer"
       DEFINE TIMER Timer_1 INTERVAL 1000 ACTION dictionary()     				
   END WINDOW

   ACTIVATE WINDOW Win
Return

FUNCTION dictionary()
   LOCAL value2 := '' , address := 'http://translate.google.com/#en|es|'

   value2 := System.Clipboard
   IF value1 <> value2
      address := address + alltrim(value2) 
      Win.Test.Object:Navigate(address)
      vaule1 := value2
   ENDIF
	
RETURN
User avatar
nguyenchiduc
Posts: 78
Joined: Sat Nov 13, 2010 7:27 am

Re: my dictionary - Google dictionary

Post by nguyenchiduc »

You can choose a web dictionary for your language.
And arranged according to personal preference when surfing the Internet.
For example I choose webiste http://tratu.vn/dict/en_vn/ for English-Vietnamese dictionary

Code: Select all

#include "hmg.ch"
Function Main
  PUBLIC value1 := ''
  
  DEFINE WINDOW Win AT 0,0 WIDTH 1152 HEIGHT 864 TITLE 'BROWSE' FONT '.vntime' size 24 MAIN 
       @ 50,0  ACTIVEX browse_web WIDTH 790  HEIGHT 780 	PROGID "shell.explorer"
       @ 50,792  ACTIVEX dictinary WIDTH 350  HEIGHT 780 	PROGID "shell.explorer"
       DEFINE TIMER Timer_1 INTERVAL 500 ACTION dictionary()
    
       @ 5,0 LABEL LABEL_1 WIDTH 100 HEIGHT 40 VALUE "http://"
       @ 5,100 TEXTBOX TEXT_1 WIDTH 930 HEIGHT 40 VALUE "" ON ENTER browse() 
       @ 5,1042 BUTTON BUTTON_1 CAPTION "Browse" WIDTH 100 HEIGHT 40  ACTION browse() 
		
   END WINDOW

   ACTIVATE WINDOW Win
Return

FUNCTION dictionary()
   LOCAL value2 := '' , address := 'http://tratu.vn/dict/en_vn/'
	
   value2 := System.Clipboard
   IF value1 <> value2
      value1 := value2
      address := address + alltrim(value2) 
      Win.dictinary.Object:Navigate(address)       
   ENDIF
	
RETURN

FUNCTION browse()
      Win.browse_web.Object:Navigate(Win.Text_1.Value)
RETURN
Image
User avatar
Rathinagiri
Posts: 5471
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Contact:

Re: my dictionary - Google dictionary

Post by Rathinagiri »

Really useful. Thanks a lot for sharing.
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
User avatar
nguyenchiduc
Posts: 78
Joined: Sat Nov 13, 2010 7:27 am

Re: my dictionary - Google dictionary

Post by nguyenchiduc »

rathinagiri wrote:Really useful. Thanks a lot for sharing.
Please help me how to get value for Navigate. Purpose to mark the BACK, NEXT when surfing the Internet.
For example:
SET : Win.browse_web.Object: Navigate (Win.Text_1.Value)
GET : ?

Is there a way similar Win.Text_1.Value := Win.browse_web.Object:Navigate() does not?

===========

If possible, we will create a personal web browse
Post Reply