Newbie Question

General Help regarding HMG, Compilation, Linking, Samples

Moderator: Rathinagiri

Post Reply
siki
Posts: 7
Joined: Tue Dec 14, 2010 5:38 am
Location: Czech Republic

Newbie Question

Post by siki »

Hello all
I'm new here, first time trying to make gui application. attached is small sample wich contain my first try.

I'm using harbour last compiled from svn
OS - Ubuntu 10.10
hmg - from svn at revision 509

Now questions:
1. Browsing database charachter's in names don't show as expected but terminal version work as expected in habbour
2. Clicking around on browse show difference on picked record and record in database as on attached picture, bigger database it is there are more problems with that. On edit window and print preview character's from database are shown correct.
3 How to lunch print preview with fit width activated
Thank you and best regards from Czech
Davor
Attachments
Snímek obrazovky-1.png
Snímek obrazovky-1.png (47.7 KiB) Viewed 2410 times
sample.zip
(3.03 KiB) Downloaded 174 times
User avatar
esgici
Posts: 4543
Joined: Wed Jul 30, 2008 9:17 pm
DBs Used: DBF
Location: iskenderun / Turkiye
Contact:

Re: Newbie Question

Post by esgici »

Hello Davor

First welcome aboard, regards from Turkiye :)

Probably you need using HB_OEMTOANSI() function.
This function convert a DOS(OEM) Character to a WINDOWS (ANSI) based character.

Syntax is :

HB_OEMTOANSI( <cOEMString> ) --> cANSIString

I hope that this help you :)

Regards

--

Esgici
Viva INTERNATIONAL HMG :D
siki
Posts: 7
Joined: Tue Dec 14, 2010 5:38 am
Location: Czech Republic

Re: Newbie Question

Post by siki »

Hello Esgici

nice to meet You

As I understand all conversion are done automatic with compiler only point where character's are not correctly presented are browse window. Is there some possibility to use hb_oemtoansi from browse window ???

long time I use clip / habour for terminal based applications without need for such conversion
attached are sample with database

thank You
User avatar
apais
Posts: 441
Joined: Fri Aug 01, 2008 6:03 pm
DBs Used: DBF, Leto, MariaDB, SQLite
Location: uruguay
Contact:

Re: Newbie Question

Post by apais »

HMG 4 is in pre alpha state.
Linux support is limited yet.
Qrids and browses aren't full finished.
QT Codepage conversion is not finished yet, nor in harbour not in HMG.

You'll have to be patient or provide a solution yourself.

Regards
Angel
Angel Pais
Web Apps consultant/architect/developer.
mrduck
Posts: 497
Joined: Fri Sep 10, 2010 5:22 pm

Re: Newbie Question

Post by mrduck »

siki wrote: 2. Clicking around on browse show difference on picked record and record in database as on attached picture, bigger database it is there are more problems with that. On edit window and print preview character's from database are shown correct.
There are problems in browse on record pointer.

BROWSE uses a "call-back" to ask for the record data/colors etc. When you click on a cell it asks data for the record you are leaving (it must redraw the cell unselected) and the cell before after and the selected one.

These call-backs are "async", generated by Qt as it needs, and so it moves the record pointer ( recno() ) and sometimes it is not left on the selected cell ! So tou MUST NOT trust recno(), also on double clicks. Instead you have to retrieve browse:value that returns the browse row and move the pointer accordingly ! I'm trying to change browse code to sync recno() but it is really useful ?

Other tests with BROWSE (samples\browse\demo_5.prg) showed that using browse on a million rows dbf using DBFNTX makes the browse almost unusable. Using DBFCDX makes the browse really quick.
siki
Posts: 7
Joined: Tue Dec 14, 2010 5:38 am
Location: Czech Republic

Re: Newbie Question

Post by siki »

Hello Angel

I'm little confused with hmg versions etc. Ok now I know that using version 4
I try most of samples, and have feeling that mostly all working very well in linux without problem
I used harbour for terminal based application and there all codepage conversion working well. Last time I try the same sample in hbxbp also working well for me with codepages
OK I try to make a look
Thank You and best regards
siki
Posts: 7
Joined: Tue Dec 14, 2010 5:38 am
Location: Czech Republic

Re: Newbie Question

Post by siki »

Hello mrduck
mrduck wrote:
siki wrote: 2. Clicking around on browse show difference on picked record and record in database as on attached picture, bigger database it is there are more problems with that. On edit window and print preview character's from database are shown correct.
mrduck wrote: There are problems in browse on record pointer.

BROWSE uses a "call-back" to ask for the record data/colors etc. When you click on a cell it asks data for the record you are leaving (it must redraw the cell unselected) and the cell before after and the selected one.

These call-backs are "async", generated by Qt as it needs, and so it moves the record pointer ( recno() ) and sometimes it is not left on the selected cell ! So tou MUST NOT trust recno(), also on double clicks. Instead you have to retrieve browse:value that returns the browse row and move the pointer accordingly ! I'm trying to change browse code to sync recno() but it is really useful ?
I think that is very important that browse update recno because after f.e double click we want to make some action print, edit, etc and we need for sure to print record pointed in browse not some other !
But how from browse:value to find actual record, or there are some other way ?
mrduck wrote: Other tests with BROWSE (samples\browse\demo_5.prg) showed that using browse on a million rows dbf using DBFNTX makes the browse almost unusable. Using DBFCDX makes the browse really quick.
I have no problem with speed for now

thank You and best regards
Davor
Post Reply