FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour to use xbrowse in dialog
Posts: 434
Joined: Wed Jun 06, 2007 02:58 PM
to use xbrowse in dialog
Posted: Sun Jan 19, 2014 11:51 AM

hallo,
I would like to use xbrowse in a dialog.
I have the dialog in myfile.dll creted with pelles C.
which "control" should I use?
thanks

FiveWin for xHarbour 24.02 - Feb. 2024 - Embarcadero C++ 7.60 for Win32 Copyright (c) 1993-2023

FWH 64 for Harbour 19.06 (MSVC++) Jun. 2019 - Harbour 3.2.0dev (r1904111533)

Visual Studio 2019 - Pelles C V.8.00.60 (Win64)
Posts: 6755
Joined: Wed Feb 15, 2012 08:25 PM
Re: to use xbrowse in dialog
Posted: Sun Jan 19, 2014 12:09 PM
Cristobal Navarro

Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noci贸n del tiempo

El secreto de la felicidad no est谩 en hacer lo que te gusta, sino en que te guste lo que haces
Posts: 434
Joined: Wed Jun 06, 2007 02:58 PM
Re: to use xbrowse in dialog
Posted: Sun Jan 19, 2014 10:46 PM

thanks for the reply,
I created with Pelles C myfile.dll and in myfile.dll I created dialog "PROVA"
i used custom control but when I choose custom control I had to type "txbrowse" (there were no classes to choose from).

this is the samples:
USE CUSTOMER NEW ALIAS (cAlias)
DEFINE FONT oFont NAME "Tahoma" SIZE 0, -12

DEFINE DIALOG odlg RESOURCE "PROVA" FONT oFont TITLE "TITOLO"
REDEFINE XBROWSE oBrw ID 200 SIZE -10,-30 PIXEL OF oDlg ;

WITH OBJECT oBrw
:nStretchCol := STRETCHCOL_WIDEST
:CreateFromCode()
END

ACTIVATE DIALOG ODLG

but when I run app.exe, fivewin return this error:
FiveWin Version: FWHX 11.12
Windows version: 6.1, Build 7601 Service Pack 1

Time from start: 0 hours 0 mins 0 secs
Error occurred at: 19-01-2014, 23:34:21
Error description: Error FiveWin/2 Duplicated Id: No: 101

any idea?
thanks

FiveWin for xHarbour 24.02 - Feb. 2024 - Embarcadero C++ 7.60 for Win32 Copyright (c) 1993-2023

FWH 64 for Harbour 19.06 (MSVC++) Jun. 2019 - Harbour 3.2.0dev (r1904111533)

Visual Studio 2019 - Pelles C V.8.00.60 (Win64)
Posts: 6755
Joined: Wed Feb 15, 2012 08:25 PM
Re: to use xbrowse in dialog
Posted: Sun Jan 19, 2014 10:48 PM

You can put here your. Rc?

Cristobal Navarro

Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noci贸n del tiempo

El secreto de la felicidad no est谩 en hacer lo que te gusta, sino en que te guste lo que haces
Posts: 434
Joined: Wed Jun 06, 2007 02:58 PM
Re: to use xbrowse in dialog
Posted: Sun Jan 19, 2014 11:12 PM

this is:
// RESOURCE SCRIPT generated by "Pelles C for Windows, version 7.00".

include <windows.h>

include <commctrl.h>

include <richedit.h>

LANGUAGE LANG_ITALIAN,SUBLANG_ITALIAN

PROVA DIALOGEX FIXED IMPURE 6, 18, 310, 186
STYLE DS_SHELLFONT|WS_POPUP|DS_MODALFRAME|DS_CONTEXTHELP|DS_3DLOOK|WS_CAPTION|WS_SYSMENU|WS_VISIBLE
CAPTION "Dialog"
FONT 8, "Tahoma", 0, 0, 1
{
CONTROL "OK", IDOK, "Button", WS_TABSTOP, 160, 5, 45, 15
CONTROL "Cancel", IDCANCEL, "Button", WS_TABSTOP, 160, 23, 45, 15
CONTROL "This is a label:", 4001, "Static", WS_GROUP, 4, 20, 40, 8
CONTROL "", 200, "txbrowse", 0x00000000, 20, 60, 240, 92
}

LANGUAGE 0,0

DVCLAL RCDATA "res1.bin"

FiveWin for xHarbour 24.02 - Feb. 2024 - Embarcadero C++ 7.60 for Win32 Copyright (c) 1993-2023

FWH 64 for Harbour 19.06 (MSVC++) Jun. 2019 - Harbour 3.2.0dev (r1904111533)

Visual Studio 2019 - Pelles C V.8.00.60 (Win64)
Posts: 6755
Joined: Wed Feb 15, 2012 08:25 PM
Re: to use xbrowse in dialog
Posted: Sun Jan 19, 2014 11:33 PM

The problem is not in the. RC
You are calling the method CreateFromCode, and you have to call the method

:CreateFromResource( nId )

Cristobal Navarro

Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noci贸n del tiempo

El secreto de la felicidad no est谩 en hacer lo que te gusta, sino en que te guste lo que haces
Posts: 434
Joined: Wed Jun 06, 2007 02:58 PM
Re: to use xbrowse in dialog
Posted: Mon Jan 20, 2014 07:20 AM

thanks mr. cnavarro,
Can you explain me the meaning of WITH OBJECT... ?
thank you

FiveWin for xHarbour 24.02 - Feb. 2024 - Embarcadero C++ 7.60 for Win32 Copyright (c) 1993-2023

FWH 64 for Harbour 19.06 (MSVC++) Jun. 2019 - Harbour 3.2.0dev (r1904111533)

Visual Studio 2019 - Pelles C V.8.00.60 (Win64)
Posts: 6755
Joined: Wed Feb 15, 2012 08:25 PM
Re: to use xbrowse in dialog
Posted: Mon Jan 20, 2014 08:18 AM

To define the properties of an object and avoid putting on each object name <oBj>: data or <obj>: method

WITH OBJECT <oBj>

: <data1>: = ...
聽聽聽聽聽聽聽聽聽聽 : <data2>: = ...
聽聽聽聽聽聽聽聽聽聽 : <data3>: = ...
聽聽聽聽聽聽聽聽聽聽 : <method> ()
END

equivalent to:

<oBj>: <data1>: = ...
聽聽聽聽聽 <oBj>: <data2>: = ...
聽聽聽聽聽 <oBj>: <data3>: = ...
聽聽聽聽聽 <oBj>: <method> ()

I hope I explained

Cristobal Navarro

Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noci贸n del tiempo

El secreto de la felicidad no est谩 en hacer lo que te gusta, sino en que te guste lo que haces
Posts: 434
Joined: Wed Jun 06, 2007 02:58 PM
Re: to use xbrowse in dialog
Posted: Mon Jan 20, 2014 10:09 AM

ok,
and now another question.
this is my code:
oDbf := oOdbc:Query( "SELECT articolo as codice, descrarticolo as descrizione, unitamisura as um, " +;
"prezzo as listino "+;
"FROM magazzino "+;
"WHERE codice = 'AAAA' "+;
"ORDER BY codice")
oDbf:Open()
oDbf:Gotop()

DEFINE FONT oFont NAME 'TAHOMA' SIZE 0,-12
DEFINE DIALOG odlg RESOURCE "PROVA" FONT oFont TITLE "TITOLO"

REDEFINE XBROWSE oBrw ID 200 OF oDlg

add to obrw data odbf:codice HEADER "Employees"

ACTIVATE DIALOG oDlg ;
CENTERED

....

odbc:query return 12 records but in xbrowse there is only the first record, why?

FiveWin for xHarbour 24.02 - Feb. 2024 - Embarcadero C++ 7.60 for Win32 Copyright (c) 1993-2023

FWH 64 for Harbour 19.06 (MSVC++) Jun. 2019 - Harbour 3.2.0dev (r1904111533)

Visual Studio 2019 - Pelles C V.8.00.60 (Win64)
Posts: 6755
Joined: Wed Feb 15, 2012 08:25 PM
Re: to use xbrowse in dialog
Posted: Mon Jan 20, 2014 10:41 AM

Find this line in the example
.../...
REDEFINE XBROWSE .....

This example can perhaps help

viewtopic.php?f=3t=27965#p156123

&

Cristobal Navarro

Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noci贸n del tiempo

El secreto de la felicidad no est谩 en hacer lo que te gusta, sino en que te guste lo que haces
Posts: 434
Joined: Wed Jun 06, 2007 02:58 PM
Re: to use xbrowse in dialog
Posted: Mon Jan 20, 2014 09:15 PM

thank you, it's very useful!

excuse me, I'm use: oOdbc := TOdbc():New( cDSN, cName, cPass ) and the example use DEFINE QUERY etc..., can you explain me what is the difference?

FiveWin for xHarbour 24.02 - Feb. 2024 - Embarcadero C++ 7.60 for Win32 Copyright (c) 1993-2023

FWH 64 for Harbour 19.06 (MSVC++) Jun. 2019 - Harbour 3.2.0dev (r1904111533)

Visual Studio 2019 - Pelles C V.8.00.60 (Win64)
Posts: 6755
Joined: Wed Feb 15, 2012 08:25 PM
Re: to use xbrowse in dialog
Posted: Mon Jan 20, 2014 09:22 PM

I think in the example they are using the class TDolphin using Mysql
In the forum there is a lot of information of that class and its Author: Daniel Garcia-Gil gives excellent help.

Cristobal Navarro

Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noci贸n del tiempo

El secreto de la felicidad no est谩 en hacer lo que te gusta, sino en que te guste lo que haces
Posts: 434
Joined: Wed Jun 06, 2007 02:58 PM
Re: to use xbrowse in dialog
Posted: Mon Jan 20, 2014 09:29 PM

Very good, thank you

Sent from my RM-885_eu_italy_299 using Tapatalk

FiveWin for xHarbour 24.02 - Feb. 2024 - Embarcadero C++ 7.60 for Win32 Copyright (c) 1993-2023

FWH 64 for Harbour 19.06 (MSVC++) Jun. 2019 - Harbour 3.2.0dev (r1904111533)

Visual Studio 2019 - Pelles C V.8.00.60 (Win64)

Continue the discussion