Fivewin Classes
--------------------------------------------------------------------------------
I first use CLASS code writing my source code.When I write about Button CLASS appear Error Info below:
Method ReButton()
Redefine Button ::oMainBut[1] ID 600 of ::oDlg ....
Redefine Button ::oMainBut[2] ID 601 of ::oDlg ....
......
RETURN nil
If it will add in my source code, it will appear Error Info below:
Error Objects/6 No Exp Method TBUTTON:DEFCONTROL
If it will not add in my source code,it will run,but not use Button option function. Do someone have any idea or suggestion for me?
You have to define u method in this way
Class myclass
Method myMethod()
....
Endclass
Method myMethod Class myClass
.....
RETURN
--------------------------------------------------------------------------------
I have implement new internet function to Wininet.prg those function are: ( SYLNET.ZIP )
InternetGetConnectedState
InternetAutodial
InternetDial
InternetHangUp
InternetAttempConnect
In the zip file you have Wininet.prg, Wininet.H (all predefined value for flag), Sylint.prg the samples who test all function. I comment as most as possible each new function in the Wininet.prg, please be aware that some function need specific version of explorer and are also ocumented.
The next step will be the implementation of secure FTP HTTP connection VIA InternetExplore OLE OBJECt ! Have fun !
--------------------------------------------------------------------------------
When I test samples\TestOut.prg and close this file,it will appear error message.This error message already appear from FW195sp5.But FW2.0a not fix it.Do someone else offers or suggestion it?Help
Change hBmpPal with hBitmap in method destroy()
--------------------------------------------------------------------------------
I have having a strange problem with the TFTP class that is based on WinINet.DLL. I am doing something like this
Function Getfiles()
oInternet := TInternet():New()
oFTP := TFTP():New( cFTPIP, oInternet ,cUser, cPassword)
aFiles = oFTP:Directory( "out/*.out" )
SysRefresh()
nFiles := 0
for n = 1 to Len( aFiles )
SysRefresh()
if aFiles[n,2] > 0
aFiles[n,1] := left(aFiles[n,1],at(chr(0),aFiles[n,1])-1)
hTarget := FCreate( aFiles[ n,1 ] )
oFile = TFtpFile():New( "out/"+aFiles[ n, 1 ], oFTP )
oFile:OpenRead()
SysRefresh()
while ( nBytes := Len( cBuffer := oFile:Read( nBufSize ) ) ) > 0
FWrite( hTarget, cBuffer, nBytes )
SysRefresh()
end
FClose( hTarget )
oFTP:DeleteFile("out/"+aFiles[ n, 1 ])
oFile:End()
nFiles++
endif
next
endif
oFTP:end()
oInternet:End()
When I run this on Win 98 if there are files it retreives them and deletes them and any more calls to the function return no files. When I run it on NT 4.0 the files multiple calls to the function keep returning the files and they are downloaded but never deleted until I exit the program and then the calls to the function show no files? It is almost like NT 4.0 buffers the session and until you exit the application does it actually update the FTP site??? Any ideas, experience or help would be greatly appreciated!
*
I posted a message last week about the TFPT class not returning the correct directory information running under NT 4.0. I have found the problem and I wanted to pass it along. In the Directory() method you need to pass a parameter to the
FtpFindFirstFile(::hFTP,cMask,@cBuffer,INTERNET_FLAG_RELOAD,0)
where the define is
#define INTERNET_FLAG_RELOAD 2147483648 // 0x800000000
What was happening is each FtpFindFirstFile() was returning the same directory from cache instead of going out the FTP server and getting the actual directory. I was doing a directory deleting the files and then logging back on an doing another directory but the directory was returning the contents from the first one even though the files were deleted. If you force it to "RELOAD" then you always get the correct information.
--------------------------------------------------------------------------------
Eu preciso executar um comando quando ocorrer um DoubleClick sobre um ítem da árvore. I need to execute a command when to occur a DoubleClick on an item of the tree.
Try this: ( NEWTREE.ZIP )
thanks for the feature ACTION(...) - thats one part I looked for. The other part is this: How would you create a treeview if you dont know the structure of the tree in advance. Think on a patient in a hospital. All the tests on him are in databases. Now you query the dbf´s an find:
Endoscopie - Gastoscopie- Dtae
Coloscopia - Date
Cardiologie - Coronarographie - Date
Echocardiographie - Date1
Echocardiographie - Date2
ECG - Date1
ECG - Date2
and so on. You put all the informations in an array and then you create the teeview. The ACTION or ON CHANGE method has to show in a second window the result of the test. Has anyone done this? I dont like to invent the wheele....
--------------------------------------------------------------------------------
New version of TTXTEDIT CLASS with REDEFINE for DIALOG usage and enhanced
function ::Save, ::Load and ::Paint
you can download it from
www.htcsoft.freeservers.com
--------------------------------------------------------------------------------
Does anyone know of any RTF class for use with fivewin? All advice and comments welcome
Test attach. ( TESTRTF.ZIP )
gracias, your code works fine and is exactly what i´m looking for. Do you have also a editor-prg for formatting your plain ascii ({negritas}, &cursivas!, [subrayado].)? Under Dos i used "CLTEXT.LIB" as a Editor for my memofields. The formating is done by char(0)-char(32). Now i´am looking for a similar solution under fivewin.
Here is what I found in former news: ( CLRTF.PRG ), ( RCHTXT10.ZIP )
--------------------------------------------------------------------------------
I'am new to use the database object. For display of a 12 month o a year, I use a FOR-NEXT loop but how to do it with Objects
Dbf : omzet1, omzet2, omzet3 ... omzet12
Odbfklant = all OK that works.
ONLY THE LOOP IS A LITTLE PROBLEM
for i = 1 to 12
jaar1 = "oDbfklant:omzet"+alltrim(str(I))
REDEFINE GET &jaar1 ID (2990+i*10) OF oDlg
next
How about make a function for your problem Now your Code
for i = 1 to 12
jaar1 = "oDbfklant:omzet"+alltrim(str(I))
REDEFINE GET &jaar1 ID (2990+i*10) OF oDlg
next
New code for you
for i = 1 to 12
ReGet ( nI, oDlg )
next
Static Function ReGet ( nIDPlus, oDlg )
Local = "oDbfklant:omzet"+alltrim(str(nIdPlus))
REDEFINE GET &jaar1 ID (2990+nIdPlus*10) OF oDlg
Return NIL
This code is not working ? Not for the nI in the loop.
Just remove the "n" from "nI", but is not enough....Do this :
for i = 1 to 12
ReGet ( i, oDlg )
next
Static Function ReGet ( nIDPlus, oDlg )
Local temp = "oDbfklant:omzet"+alltrim(str(nIdPlus))
REDEFINE GET &temp ID (2990+nIdPlus*10) OF oDlg
Return NIL
Sorry
Almost My code use nI when Using FOR NEXT loop Please modify nI to i
--------------------------------------------------------------------------------
Class TBitmap - Method VScroll / HScroll - Case nWParam == SB_THUMBPOSITION is not active. Can anybody help me to activate it ?
Here the tips
case nWParam == SB_THUMBPOSITION
::nX = - nLParam * (::nXExtra()+If(::oHScroll:nMax!=0,GetSysMetrics(3),0)) / ::oVScroll:nMax
::Refresh()
::oVScroll:SetPos(nLParam)
--------------------------------------------------------------------------------
Just a general question. Is anyone thinking about or perhaps want to collaborate on a FiveWin Class for XML-
1. format/write
2. read in as data
3. convert to HTML
4. display as FiveWin tree-view
5. sub-class for external sources, i.e. Excel/Oracle
Stan - great idea. Actually, I would want something that is SIMPLE - conceptually simple to create/change/maintain -> yet as powerful as xml can be. Additionally, I see it as a method for fivewin and harbour to communicate with java and other data-based systems as WELL as direct web page usage. This means that we MUST go beyond the level that, for example, the rtf class went. Finally - by helping, I'll have learned even more about xml, I'm certain. Let me know -> I'm doing things java as well as fivewin and am interested!=) -Jim
I'd be interested in making GX write out XML for reports. Count me in!
A good starting place for the 'big picture' is probably
www.odi.com/excelon and I have seen several Java scripts for parsing Oracle Tables into XML. I am specifically looking at taking a given FiveWin Table (dbf, I assume) and writing a Standard DTD (Data Table Definition) to output to XML and or import from XML/ASCII. Years and years ago I worked with a guy here in Raleigh to generate CDF's Complete Definition of Fields) for Clipper and I later used it in FiveWin with something I posted called Winparse. A CDF was an ASCII file like
ID |C| |10| |0| substr(cRec,27,10)
where ID=field name followed by Field Type,Length,Decimals, and parsing 'code-block'. Not a big deal, but I think the same principle as one would need for XML. You would need to add definitions for Data, Export Translations (i.e. would date be exported as YYYYMMDD or MM/DD/YYYY, logicals as -1=True, 0=False)
I am hoping that perhaps a group of us could come up with a DTD format, then a generic 'class' to read/write and associate DTD's with tables. Then this class could be sub-classed for say Oracle (so that rather than restricting the Field Type to C,N,L,D,M you could account for Blob or TimeStamp). Right now, just an exciting prospect, so excuse my babbling. I will be seriously working on this by mid-December, as our Company may need to provide select 'call detail' (grouped information on how calls terminate) to major carriers. We have already received requests for Excel.Access,ASCII, EMI,and even XML. Thanks for your interest - more to come
--------------------------------------------------------------------------------
I am having a strange problem when using the TPages class. Right after I have saved my resources (.DLL file), and recompiled the application, the dialog using the tpage control loads correctly. However, If I reboot the computer, and try to load the same dialog again, the application goes into an error, with thefollowing error message:
Application
Path and name: C:\PCWIN\PC.EXE
Size: 1,833,600 bytes
Max files handles permited: ( SetHandleCount() ) 150
Error ocurred at: 03/12/1999, 15:36:25
Error description: Error FiveWin/3 Cannot create Dialog Box:
Resource: Cliente
Stack Calls
===========
Called from LOCKERRHAN(0)
Called from (b)INITHANDL$(0)
Called from CREATEDLGE(0)
Called from TDIALOG:ACTIVATE(0)
Called from CAD_CLI(485)
Called from (b)LISTCLI(34)
Called from TWBROWSE:LDBLCLICK(0)
Called from TWBROWSE:LDBLCLICK(0)
Called from TWBROWSE:HANDLEEVEN(0)
Called from WINRUN(0)
Called from TMDIFRAME:ACTIVATE(0)
Called from MAIN(1138)
System
======
CPU type: 486
Hardware memory: 30464 (29 megas)
Free System resources: % 92
GDI resources: % 93
User resources: % 92
The same occurs when I try to load the program thought the network. What can be wrong?
Try adding the following to your startup code:
hBorland := LoadLibrary( "BWCC.DLL" )
and then:
FreeLibrary( hBorland ) in your exit code.
Someone in this NG has figured out how to run controls from resources without requiring BWCC.DLL, maybe they can chime in here and explain how it is done. I am not using Borland custom controls, yet for some reason, my programs won't run without loading the DLL.
I have included the suggestion, and now everything works fine. Thank you very much! In the meantime, I discovered another anomaly, which occurs if you do not load the librady BWCC.DLL: The dialogs using the TPages code only runs if you load Borland Resource Workshop, what, perhaps, loads anything into memory that allows the program to "find" something. Perhaps the use of the BWCC.DLL library should be better explained in the help files, the samples, and in the Fivewin manual. I believe that many people are having the same problems that I did.
>The dialogs using the TPages code only runs if you load Borland Resource
>Workshop, what, perhaps, loads anything into memory that allows the program
>to "find" something.
This is because Workshop loads BWCC.DLL into memory. Only one copy of a DLL is loaded into memory at a time. If a program requests a DLL that is not already loaded, then it is loaded and the counter for that DLL is set to 1. If the DLL is requested again by another program then the counter for that DLL is incremented by 1. When the first program that quits and requests that the DLL be unloaded, the counter is checked. If it is greater than 1, then the counter is merely decremented by 1. If the counter is 1, then the DLL is unloaded.
>Perhaps the use of the BWCC.DLL library should be better explained in the
>help files, the samples, and in the Fivewin manual. I believe that many
>people are having the same problems that I did.
Granted it should be. You might find some useful information in my "Introduction to FiveWin" article available on the FiveWin pages of my web site at
http://ourworld.compuserve.com/homepages/jbott It has some information about BWCC.DLL.
I quit using bwcc.dll some time ago because it caused me too many problems. A lot of weird problems went away when I quit using it. I just don't use any borland controls. If you have one borland control in your .dll then you need bwcc. I don't recall if it something in the STYLE line or what but you can probably edit your .rc file in an editor and do a search for Bor or BS_ in the style. None of the standard controls are borland, only the custom ones I believe.
--------------------------------------------------------------------------------
More than once i read in this NG about changing the CLASSES ? What should be done with a changed class, and how ? Is it something like changing a function in clipper.lib ?
Marc, I think the ng means change the FiveWin classes. As you probably know, FiveWin is heavily based in Objects, the object engine of FiveTech. A class is the base of Object oriented programming. A class is a template where you derivate or create objects. Usually you never touch the code in a class, you derivate a new class from a existing one, a process called inheritance and then add the new features to the new class This process have nothing to deal with the Clipper.lib.
There is an introduction to FW OOP article on my website (see below).James Bott
http://ourworld.compuserve.com/homepages/jbott
here is part II of the introduction located ??
Sorry, I haven't written it yet. There didn't seem to be enough interest to warrent it.
--------------------------------------------------------------------------------
I have created a class as of the class TBUTTON called TBDESP I have preceded 8 parameters before of the nId
METHOD
ReDefine(nTipo,cCampo,cExquie,cRutina,cRutf4,cExaminar,cCacebera,cCaja,nId, bAction, oWnd, nHelpId, cMsg,;
lUpdate, bWhen, bValid, cPrompt, lCancel ) CONSTRUCTOR
Then within method transfer 8 parameters to variable of instance as makes it the class original TButton
METHOD
ReDefine(nTipo,cCampo,cExquie,cRutina,cRutf4,cExaminar,cCacebera,cCaja,nId, bAction, oWnd, nHelpId, cMsg,;
lUpdate, bWhen, bValid, cPrompt, lCancel ) CLASS TButton
DEFAULT oWnd := GetWndDefault(), lCancel := .f.
::minTipo = nTipo // Tipo de desplaz
But upon executing leaves this Error .
Error description :Error Objects/6 No Exp. Method: TBDESP:_MINTIPO
Now if variable use static to the beginning of the program and I collect the value when there is 2 bellboy of this type both have the same values. Which is the solution
Have you defined
DATA minTipo
for your new class?
If you haven't already read it, I might suggest that you read my article "Introduction to OOP using FiveWin" on my website (see below). I'm not exactly sure what you trying to do. To create a subclass you need to do it this way:
create class TBDESP from TBUTTON
var minTipo // any new ivars must be defined here
method redefine constructor
endclass
// Initialize any new vars here, then call the parent method (super)
method ReDefine(nTipo,cCampo,cExquie,cRutina,cRutf4,cExaminar,;
cCacebera,cCaja,;
nId, bAction, oWnd, nHelpId, cMsg,;
lUpdate, bWhen, bValid, cPrompt, lCancel )
::minTipo := nTipo
return super:redefine(nId, bAction, oWnd, nHelpId, cMsg,;
lUpdate, bWhen, bValid, cPrompt, lCancel ) // call parent
>Error description :Error Objects/6 No Exp. Method:
> TBDESP:_MINTIPO
You get this error because you didn't define mintipo as a new instance variable. You must define any new instance vars in the class definition. Also, you cannot pass these new vars to the parent class because it doesn't know them. Note also that you cannot use the command syntax anymore, you will have to use OOP syntax:
oBtn:= TBDESP():new(...)
--------------------------------------------------------------------------------
I am trying to compile and run the "TSmtp with socket RASDial" sample I download from this news group. But, I need TReg32 to do this. There is no authors name in these files so I don't know who wrote it. If anyone could help I would appreciate it.
This class comes with fw 1.95 and only works with this version or newer.
--------------------------------------------------------------------------------
I've created a class that contains a Database-browser in a Window. It opens a database-object, a standard buttonbar, some messagebar-stuff, and a standard popup-menu. All I have to do is to call the function with the name of a dbf-file, and the standard behaviour like navigation, switching indexes, seeking, filtering,... goes quite well.
I've included the possibility to modify the standard behaviour, like fonts, columns ( width, freeze, bitmaps,... ), header, footer, ... via items in an associated ini-file. So far so good.
I thought to alter via the same way the behaviour of a button in the buttonbar by naming a function, that is outside the class-object itself, in the ini-file. This function should be compiled at runtime, instead of the build-in standard behaviour, but the only thing that's wrong is that I don't know how to give a reference to the window-object itself in that function. I need this reference since all the data of the dbf are contained into the class-object itself ( I need the so-called "Self" ). Can anyone help me ???
Suppose your app have "test.ini", your class reference is ob, and prototipe of the function SomeFunc(ob)
[some]
show = SomeFunc
Then you call from the button ACTION DoThis(ob)
Procedure SomeFunc(ob)
ob:ShowMessage("tralala")
return
You may be interested in my "Introduction to OOP using Fivewin" article available on my web site. James Bott
http://ourworld.compuserve.com/homepages/jbott
--------------------------------------------------------------------------------
We have discovered something about Fivewin Objects that we didn't know.
oBj := MyObject():New()
for i=1 to len(oBj)
Msginfo(oBj[i]) // display all properties including inheritance
next
oBJ[5] := "test" // assign 5th property
Aeval(oBj,{|aval,x| oBj[x] := NIL }) // NIL out entire Object
An object can be treated like an array. Properties can be set and viewed by their index order? Does must mean that no Object can have more than 4096 properties? Knowing this we can scan the object looking for a certain property without knowing the name of it? There are probably other possibilities as well. Has anyone taken advantage of this feature?
There is also function, getDatas( oObj ) that returns an array containing all the objects properties.
>Does must mean that no Object can have more than 4096 properties?
I would offer, that an object that complex probably needs to be redesigned perhaps breaking it down into several smaller objects.
>Knowing this we can scan the object looking for a certain property without
>knowing the name of it? There are probably other possibilities as well.
>Has anyone taken advantage of this feature?
I haven't thought of a good use for it yet--other than object inspection for debugging. There is an object inspector somewhere in the sample code that you can link into your application for debugging work. I have done that before.
Yes, this is very useful if you do not know the properties (methods and data vars.) But if know the physical names you can call the properties by the names.
--------------------------------------------------------------------------------
Error in TPrinter Class?
I use a sentence like this one :
oPrn:CmSay( 1.0 , 1.0 , cName ,oFont , 20)
(syntax : <oPrn>:CmSay( <nRow>, <nCol>, <cText>, <oFont>, <nWidth>, <nClrText>, <nBkMode>, <nPad> ) )
If I understand well, this should result in printing cName with a maximum length of 20 cm. But if the cName is printed with its full length, even if it is longer than 20 cm. What can I do to just print the first 20 cm of cName ? Thank you very much in advance.
The cmSay() method in turn calls Say() method. But if you look at the code, nWidth is not ever used, so it won't work anyway. Maybe we need to check the TextOut() funcion there to see if it accepts a nWidth param.
I made the following changes to my 1.9.1 version of TPrinter:Say() method:
METHOD Say( nRow, nCol, cText, oFont, nWidth, nClrText ) CLASS TPrinter
local aRect
if oFont != nil
oFont:Activate( ::hDCOut )
endif
SetbkMode( ::hDCOut, 1 ) // transparent
if nClrText != NIL
SetTextColor( ::hDCOut, nClrText )
endif
if nWidth == nil
TextOut( ::hDCOut, nRow, nCol, cText )
else
aRect = { nRow, nCol, nRow + oFont:nHeight + 10, nCol + nWidth }
ExtTextOut( ::hDCOut, nRow, nCol, aRect, cText )
endif
if oFont != nil
oFont:DeActivate( ::hDCOut )
endif
return nil
The API ExtTextOut() cut the printing outside the given aRect.
We decided not to use ExtTextOut because it slowed the report considerably, BTW Enrico's way maybe the right solution. Please try to use Enrico's code and I will highly appreciate your feedback in case we can include it on Fivewin next release.
--------------------------------------------------------------------------------
find attached a ZIP with a new class to make rounded TGroup groups. You can set what controls you want to see "transparent" inside the box and which not. See the images. ( RGROUP.ZIP )
--------------------------------------------------------------------------------
Just to save you Time ! Be aware that if the Socket is in WSAEWOULDBLOCK state and you call the METHOD END() .or. CLOSE() of the class Tsocket you will go in an infinite loop in the Method End() or Close(). And the Closesocket will Never occured nor the Wsacleanup and probably the Application will Crash !
There is 2 workaround:
1- Always check Osocket:lsending before calling those method
2- Remove the While ::lsending from those method
--------------------------------------------------------------------------------
When i observe my EXE, i found there is a string TFOLDER, TPRINT, etc, but I am definitely sure that I did't use any of that classes. Is it
only a string or the class it self? If yes, why these classes linked-in even though I didnt' use it? How to avoid this?
All the classes and functions are contained in the Fivewin Libs. Maybe you dont use them, but they are inside those libs.
They dont produce any harm, but increase the space of your EXE. Maybe you can try to extract those modules with Librarian
Utilities from Borland, like Tlib and others.
--------------------------------------------------------------------------------
Can someone tell me what the INLINE function stated in a class realy does ? and how it works ?
INLINE just lets you create a method in the same line as you define it:
class TCustomer
method boo inline msgInfo("Boo")
endclass
This above is the same as:
class TCustomer
method boo
endclass
method boo
msgInfo("Boo")
return nil
Thnx James for the explanation !
but what if i make a class with the new as constructor but i want to activate it at a sertan point with letst say doit in my experience in the execution of doit() i cant retrieve the data like
DATA 1
.........
DATA 5
METHOD New( 1,2,3,4,5 ) Constructor
METHOD DoIt()
nTemp := ::1 + ::2 / ::5
cTemp := ::3 + ::4
It gives me an object message error
so to activate it an retrieving this parameter i have to pass the object
made with new eg oTest := Ttest():New( 1,2,3,4,5 )
DoIt( oTest )
Method DoIt( o )
Then i can retrieve o:1 etc.
there must be another way couse now i have to work with inline to pass some known data
hope this make some sence
I'm sorry, I don't understand what you are trying to do. Can you put together a small sample program that shows the problem?
--------------------------------------------------------------------------------
oMemo:
There is a method On Change that is evaluated every time there is a changein a memo. Is there also a possibillity to detect a movement of the cursor.
Have you tried with bKeyDown or bKeyChar code-blocks? Eventually you can trap cursor movement inside HandleEvent() method, I think.
I have tried the bKeyDown mehod and it works. I can execute a function on arrow down left and so on. But what I want is that de cursor also goes down or up,left and so on.
Now the function is called but the cursor stays on the same place.
I think I will have to learn to work with handleEvent(). I hope the sample dir contains enough examples.
Try sending a WM_KEYDOWN message with the appropriate VK_* as second parameter inside your bKeyDown code-block or using SetPos() method to move the cursor position. Or it could be enough returning NIL (not zero)
from bKeyDown.
Yes this works fine.
Pheraps after you call yourfunction() you return 0 (zero) from KeyDown(). To continue Fivewin perform standard behavior (moving cursor) after that you should return (nil)
--------------------------------------------------------------------------------
It looks like nobody other has troubles with the DbCombo class.
Perhaps anyone could tell me how to interpret the following lines from myerror.log
Error description: Error BASE/1070 wrong argument: ==
Args:
[ 1] = U
[ 2] = N
Stack Calls
===========
Called from TGET:DESTROY(0)
Called from TGET:DESTROY(0)
Called from TDBCOMBO:DESTROY(0)
Called from TDBCOMBO:HANDLEEVEN(0)
Called from DIALOGBOX(0)
Does this mean that my app crashes when trying to destroy a second get-object?
I don't know where to search this second get.
I don't have FW 2.2c and don't use dbCombo, but try to get a look at TGet:destroy() (in tget.prg) and see what this method is trying to compare since the expression on the left is nil. Then try to trace that value down the call stack.
thanks a lot for jumping in. Unfortunately the method TGet:Destroy() doesn't take any parameters
I think the cause of my crash is that the destroy method is called two times. ( i don't know why 2 times ? ).
The second call of course then gets an undefined value
You said that you don't use TDbCombo. Could you tell me what you use instead?
I use a lookup table system I designed a long time ago with a friend. I assign a bitmap inside the get that in turns launches a dialog with a browse of the dbf, allowing the user to choose the code, as well as search and add/edit the table.
I attach with this message the corrected file to use.
Sorry for any inconvenience. (Ignazio Ortiz) window.ZIP
many thanks for your quick reaction. Now the dbCombo is destroyed without crash.
--------------------------------------------------------------------------------
Can anyone tell me how to use the getminmax method to control sizes of some dialogs.
I believe it only works on Windows, not Dialogs, but of course I could be mistaken.
I've only used GetMinMaxInfo on Windows and it works pretty neat.
--------------------------------------------------------------------------------
I need made my personal ::Paint() Method for TGet, but when I declare it, none appear in my gets. I need help, please. This is only a test, but don't work. Why ?
METHOD Paint() INLINE Super:Paint()
METHOD Display() INLINE ::BeginPaint(), ::Paint(), ::EndPaint(), 0
One simple solution could be to add something like this in the Paint() method of TWindow class:
if ::aControls != nil
AEval( ::aControls, { | oCtl | If( Upper( oCtl:ClassName() ) == "TCOMBOBOX", oCtl:Display(), ) } )
endif
Great Enrico, but no work like I need:
I need draw an box inside each get of an dialog. If I use:
METHOD Paint() INLINE ::Box( x, y, x1, y1 )
METHOD Display() INLINE ::BeginPaint(), ::Paint(), ::EndPaint(), 0
The box is displayed, but the get don't display his buffer...
If I use your hint, the box is displayed, but, if I open other small dialog inside first dialog, when I close the second dialog, the boxes in this region are cleared.
I don't understand why I can't use Display(), Paint() methods, like a lot of classes use ( ex: splitter class )...
Uhm... I think you can't draw a box *inside* the client area of a GET. You have to create a non-client area.
> I don't understand why I can't use Display(), Paint() methods, like a
> lot of classes use ( ex: splitter class )...
Sorry, I don't know exactly why...
Ok. I think that I need make my personal TGet class. My intention is make skins for fivewin, I have implement skins in buttons and combobox, like windows XP style, but I need implement in TGet, radio and checkbox. Please, see attached picture. I was looking in the FGet class and have some ideas...
Hey, that looks GREAT!! Is this a FiveWin app?
Yes it is and is running in a windows me
I'm try to make skins with five. There are a har job, but I have some
controls, like buttons, working fine. The problem is with TGet that don't use ::Display() and ::Paint() Methods...
Lets go to work!
If you are trying to create down arrow buttons within the GET then you need Ricardo Ramirez's (
rramirez@landatech.com) TBtnGet. His website is:
http://www.landatech.com
You may find a copy on his website (I can't tell because it seems to be down right now). Ricardo is travelling right now, so it may be a couple of days before you hear back from him if you email him.
No. I don't need TBtnGet. I need draw a box inside client area of my gets, but the box is don't displayed...
The problem is that TGet or TBtnGet don't uses :display(), :paint() methods. I don't know why...
have you tried to create a box control belonging to the get? That is, ..... OF oGet
Yes its works, but my intention is redefine all style get, replacing 3D standard box of an get to my style box, to simulate the box displayed by windows XP. If you look the picture attached previous, you are see that I have success with buttos, folders and comboboxes, but the get...
I've never try it, but IMO you have to handle the WM_NCPAINT msg. Try to write a msg handler for TGet...
This info is from Win32s.hlp:
WM_NCPAINT
An application sends the WM_NCPAINT message to a window when its frame must be painted.
WM_NCPAINT
hrgn = (HRGN) wParam; // handle of update region
Parameters
hrgn
Value of wParam. Identifies the update region of the window. The update region is clipped to the window frame.
Return Values
An application should return zero if it processes this message.
Remarks
The DefWindowProc function paints the window frame.
An application can intercept this message and paint its own custom window frame. The clipping region for a window is
always rectangular, even if the shape of the frame is altered.
See Also
DefWindowProc, GetWindowDC, WM_PAINT
Thanks Jose, I'll try.
Try by sending the box painting on the ON PAINT clause of ACTIVATE WINDOW (or DIALOG)
ACTIVATE DIALOG oDlg ON PAINT Your_DrawBox()
Or:
odlg:bPainted := {|| Your_DrawBox() }
I think that is no a good idea because I neet the repaint automatically. Remember that my intention is made skins (see previous picture).
PS: I have a complete set of tsbrowse for harbour working, but with some problems. Do you have fwin for harbour to we finish this work ?
I am now starting my work with FWH and the main task will be to make TSBrowse Harbour compatible. Please send me what you have done, it'll be a great help.
--------------------------------------------------------------------------------
there is an error on talbum class with fivewin 2.2c Some has corrects this error :
C:\errori\album>blinker fi prueba, album, CES @\fw22\include\fivewin
__ __
(«») («») BLINKER DOS Extender and Windows Linker 5.10
___ Blink and you'll miss it !!
Copyright (c) Assembler Software Manufacturers, Inc. 1990-99
All Rights Reserved. Serial # BR-056596. Fax (804) 784-2357.
BLINKER : 1115 : ALBUM.OBJ(ALBUM) : 'PBMPHEIGHT' : unresolved external
BLINKER : 1115 : ALBUM.OBJ(ALBUM) : 'PBMPWIDTH' : unresolved external
BLINKER : 0 Warning error(s), 2 Fatal error(s)
PRUEBA.EXE (not created) (0.7 seconds)
C:\errori\album>if errorlevel 1 goto exit
This is extract from Whatsnew.txt in Fw22c:
* Important change: In order to turn FiveWin fully compatible with 32 bits architecture, we had to replace Class TBitmap's hBmpPal use with a two new DATAs hBitmap and hPalette. This should not break any of your existing code, except on those places where you may be accessing hBmpPal directly. Simply replace hBmpPal for hBitmap and it will be ok. Also notice that pBmpHeight() and pBmpWidth() no longer exist, and must replaced by nBmpHeight( hBitmap ) and
nBmpWidth( hBitmap ) calls.
--------------------------------------------------------------------------------
Everyone,
At long last I have published Part II of my "Introduction to Object-Oriented Programming Using FiveWin" article. You will find a link to it on this page:
http://ourworld.compuserve.com/homepage ... rogram.htm
Comments welcome.
James Bott
Good work! Only a note:
> According to OOP principles of information hiding, you should hide
> any data and methods that are only needed for internal use of the
> class.
Actually, OOP principles say that a class should only have hidden data. It should only offer "services" implemented as methods and never show implementation details to the client code (that is the code that uses the class).
In one line thanx for the fine contribution wich will help me ! and i'm convinced a lot of others 2.
This is what we needed
thanks a lot for your oop introduction. It reads very interesting a gave me lots of new insights to oop with FiveWin.
I got curious about your tdata class and tried the demo version. Unfortunately test05.prg does not run ( missing test.dbf ).
In test04.exe there is sopmething strange. If after double click I modify the name of a customer and say ok,
after I can't click on lines below this customer and the record remains at it's old location even if after editing it should appear as logical last one.
Perhaps I'm doing something wrong?
> I got curious about your tdata class and tried the demo version.
> Unfortunately test05.prg does not run ( missing test.dbf ).
Actually, test05.prg wasn't supposed to even be in the zip. Further, it was
test03.prg that was calling the missing test.dbf.
> In test04.exe there is sopmething strange. If after double click I modify
> the name of a customer and say ok,
> after I can't click on lines below this customer and the record remains at
> it's old location even if after editing it should appear as logical last
> one.
You spotted another problem here. I had forgotten to initalize ::lAdd to .f. so it was appending a record.
My apologies for all the problems. I have just uploaded a new version of TData.zip containing all the fixes and also the very latest version of TData itself. Hopefully everthing is working now.
Please download the new version and try the sample programs again.
--------------------------------------------------------------------------------
As I can modify the label of the TGROUP control ?
oGroup:cCaption: = " New title " or oGroup:SetText("New title") does not have effect.
You have to make sure you call ::SetText after the dialog has been activated, or nothing will happen, ie
Define Dialog oDlg ....
Redefine Group oGroup Of oDlg...
Activate Dialog oDlg On Init oGroup:SetText( "whatever" )
--------------------------------------------------------------------------------
I build testfget.prg from \fw22c\samples and when I try to execute it it freeze at startup can someone confirm that building and executing testfget on his FW2.2c version work !
If so I'll search my problem ! ;-( Fivewin 2.2c Clipper 5.3b Blinker 6.0
The problem is with the TEXT.DBF and TEXT.DBT file that came with Fivewin even the one that are in Fivewin 2.3 are corrupted !
You're right !, some kind of problem is with the packed version of FGET that comes with FiveWin.
Anyway you can download the latest version of the FGet from the "father of the baby" website Ramon Avendaño.
http://personales.mundivia.es/rar/SOBREFW.HTM
Look for the link to the FGET class and download the latest version (along with other nice controls).
--------------------------------------------------------------------------------
Has anyone a sample of the TS SyncChild Method ??? It is supposed to synchronise 2 browses.
I have not heard of anything like this.
Just use the bSkip codeblock of the parent browse to skip and redisplay the child browse.
What SyncChild() method does is to evaluate one or several code blocks (as many as "child" browses you have), every time the row changes in the main browse.
Here a little sample:
Lets suppose that you have a main browse with customers names and two "child" browses, one which shows the customer due balance and other which shows the transactional history of the refferenced customer.
Defining the browses:
REDEFINE BROWSE oMain ALIAS "Customers" OF oDlg
ADD COLUMN TO oMain TITLE "Name" DATA Customers->Name
REDEFINE BROWSE oChild1 ALIAS "CustBalances" OF oDlg
ADD COLUMN TO oChild1 TITLE "Invoice" DATA CustBalances->Invoice
ADD COLUMN TO oChild1 TITLE "Date" DATA CustBalances->Date
ADD COLUMN TO oChild1 TITLE "Balance" DATA CustBalances->Balance
REDEFINE BROWSE oChild2 ALIAS "CustHistory" OF oDlg
ADD COLUMN TO oChild1 TITLE "Transaction" DATA CustHistory->Transaction
ADD COLUMN TO oChild1 TITLE "Date" DATA CustHistory->Date
ADD COLUMN TO oChild1 TITLE "Import" DATA CustHistory->Import
bBlock := { | oChild | oChild:SetFilter( "CustCode", Customers->CustCode ), oChild:Refresh() }
oMain:SyncChild( { oChild1, oChild2 }, { bBlock, bBlock } )
And, that's all, every time the row changes in oMain, the child browses will be automatically set to show the proper data.
In this little sample I'm using ntx indexes, but you can also use cdx with scopes then, in the code block, you have to set the scopes. I hope this help you.
--------------------------------------------------------------------------------
I was just looking over my XBase++ 1.7 documentation and noticed a class called oThread. This allows you
to open an additional thread and run an app in. Is this available in Fivewin?
If you try to run an application from another application is a new thread by it self...
i guess oThread is something else...
as i can imagine ... oThread create a new session and assign a job to do ... for example to copy a file with out stop your application from running
for example in C++ i wrote a web server ... i start a new thread for every new connection, so if the remote user request something the server does not stop all other jobs ...
there is a limit on threads you can open only 2048 threads in one application but you can increase it by decrease the stack size ( default is 1M per thread ).
Not yet, but you can use a timer to do certain background processes.
How can I use threads with FW? Where can I find some examples using threads?
You can't - FW is 16bit.
--------------------------------------------------------------------------------
Toutlook Class - Is ther such a thing?
FW 2.3 has a nice TOutlook class with a lot of fancy improvements.
We are not (YET) upgrading to FW2.3 for some economic reasons. As you can see, our company sales drop to a huge percentage. If we recover, I may able to justify an upgrade.
--------------------------------------------------------------------------------
When doing:
redefine group oGRP id 800 of oDLG color "N*/W"
the color-clause will not be used. Same with a self defined group.
What can I do ?
In GROUP.PRG there's
::SetColor( nClrText, nClrPane )
::SetBrush( TBrush():New( "NULL" ) ) // Debe ser transparente [byHernan]
Remove SetBrush() call and colors will work again.
--------------------------------------------------------------------------------
Inc(), Dec()
Does anyone have an example of using these methods?
It the data type your using is either numeric or date, simply do a
oGet++
or
oGet--
To increment or decrement the value of the variable assigned to the TGet object
For example, to use the PLUS and MINUS keys to change a date
dDate := Date()
Redefine Get oGet Var dDate Picture "@D" ;
Spinner // (*) this will do the same as bKeyDown, only using a spinner
oGet:bKeyDown := {|nKey, nFlag| ; // method overloading in action:
If( nKey == VK_ADD, oGet++, ; // "+" pressed [TGet:Inc()]
If( nKey == VK_SUBTRACT, oGet--, Nil ) ) }; // "-" pressed [TGet:Dec()]
(*) Assumes you have the Vertical Scrollbar attrib check in your dll/rc
Thanks, I've tried this and it doesn't seem to work. I modified the keydown method of tget to call ::oGet:inc() and that didn't work either, no exported method.
What version of FW are you using? I have 2.1c and works just fine. This feature must have been added around FW 2.0
--------------------------------------------------------------------------------
am trying compile btnget in FW and FWH :
IN FW :
CLIPPER BTNGET\FWCAL /N/M/A/W
CLIPPER BTNGET\Btnget /N/M/A/W
CLIPPER BTNGET\Btndown /N/M/A/W
BCC -c -ml -O2 -G -B -I\wk_fw\_inc -oGetbtn.obj Btnget\getbtn.c
Tlib WLIB3_16 -+fwcal -+btnget -+getbtn
IN FWH
harbour BTNGET\Btnget.prg /n /i%Fwhdir%\include;%Hdir%\include/oBTNGET\Btnget.C
bcc32 -M -c -D__HARBOUR__ -I%Hdir%\include -oBTNGET\Btnget.OBJBTNGET\Btnget.C
harbour BTNGET\Btndown.prg /n /i%Fwhdir%\include;%Hdir%\include/oBTNGET\Btndown.C
bcc32 -M -c -D__HARBOUR__ -I%Hdir%\include -oBTNGET\Btndown.OBJ BTNGET\Btndown.C
bcc32 -M -c -D__HARBOUR__ -I%Hdir%\include;%Fwhdir%\include -oBTNGET\Getbtn.
OBJ BTNGET\Getbtn.C
tlib WLIB3_32.LIB -+btnget -+btndown -+getbtn
This is correct ???
I use the attached makefile for BCC5.5 to build TBtnGet32.lib
I hope this help MAKEFILE.DAT
Ricardo, thanks, and to fivewin 16????
Sure, here is TEST.LNK
when i compile getbtn.c i receive the error :
Error : unable to execute command 'tasm.exe'.
i am using borland c 5.2 (bcc.exe)
BCC -3 -c -ml -O2 -G -B -Tq -I\wk_fw\_inc -oGetbtn.obj Btnget\getbtn.c
Could you explain to me why each BCC modificator in your statement ?
Why -B ? (compile via assembler ?????)
Why -Tq ? (assembler option ??????)
Why -oGetBtn ? (it isn't necessary)
i am using make provide by ricardo ramirez, he´s using this modificator....
Erase the -B switch, that must work
--------------------------------------------------------------------------------
I am new to fivewin and don't konw how to subclass an existing class .
HOW TO CREATE A CLASS FROM EXISTING CLASS OR SELF CREATED CLASS ?
AND IS THERE ANY EXAMPLES ?
You can find a lot of samples on the SAMPLES directory. Keep in mind that many of the FW classes are inherited from TWindow or TControl (even inherited from TWindow).
This inherits from the FILEBASE class. It compiles in either Fivewin/Clipper, or Harbour without FiveWin.
I think it's an older version from a few months ago, but should compile ok.
*****************************************************************************
/* Optional output file for the Cellular Automata class */
#INCLUDE "Common.CH"
#ifdef __HARBOUR__
#include "hbclass.ch"
#else
#include "FiveWin.Ch"
#endif
CREATE CLASS CAOutFile INHERIT FILEBASE
DATA cChar INIT "." PROTECTED // Default output character for two-color mode
DATA nWidth INIT 500 PROTECTED // Default line width
METHOD New( strFilePath )
METHOD SetChar( cChar )
METHOD GetChar()
METHOD SetWidth( nWidth )
METHOD GetWidth()
METHOD EndLine()
ENDCLASS
//--------------------------------------------------------------------//
METHOD New( strFilePath ) CLASS CAOutFile
DEFAULT strFilePath TO "WhatThe.TXT"
IF File( strFilePath )
FErase( strFilePath )
ENDIF
Super:New( strFilePath )
::Create( strFilePath )
SetChar()
SetWidth()
return Self
METHOD SetChar( cChar )
DEFAULT cChar TO "."
::cChar := cChar
Return Self
METHOD GetChar()
Return ::cChar
METHOD SetWidth( nWidth )
DEFAULT nWidth TO 500
::nWidth := nWidth
Return Self
METHOD GetWidth()
Return ::nWidth
METHOD EndLine
FWrite( ::Handle, Chr( 13 ) + Chr( 10 ) )
Return Self
There are two articles on OOP programming using Fivewin on my website:
http://ourworld.compuserve.com/homepage ... rogram.htm
--------------------------------------------------------------------------------
I am so sorry to send this mail.
My English is poor. I just want to know some questions that is my doublts for long time.AND until now nobody had
talk about that. Maybe nobody knows that except original author! but I believe that someone have the ideas about that, right?
The question description :
Why The "MAIN()" is FiveWin program's main entry? and Fivewin how to direct the windows message on to the
o:HANDLEVENT() method, I had studied the book "WINDOWS++", I know the "subclassing" with the c++ but I don't know how does "c" function "GetWndProcess()" access the clipper's object method in FIVEWIN?
In "WINDOWS++" I know that THE class "WPApp" has one method "Main()". If FIVEWIN's main entry
function is the same as this Main()?
Could someone answer me these questions? Many many .... thanks!
> The question description :
> Why The "MAIN()" is FiveWin
> program's main entry?
It may be Main() or simply the first PRG start function. The name is not important. The application entry point
is routed to the PRG start function.
> direct the windows message on to the
> o:HANDLEVENT() method
When the windows procedure gets a message, it locates the related Clipper object to such window, and jump from
C level to PRG level.
Many thanks for your answer!
But I still don't understand What does means "jump from C level to PRG level" ?
Does C program can call the PRG program?
How to do? Could you teach me? For examples with pesudo code or any other else.
--------------------------------------------------------------------------------
I'm trying to use the trichedit class. It seems like the class in not included with the fw libs. I get an error from the linker stating that trichedit() is an unresolved external. So I tried to compile the .prg but there is an ambigous reference: "COLOR_BTNFACE'. Anyone using the Richtext class has an alternative or solution to this problem?
All the COLOR_xxxxx constants are in wcolor.ch. So just #include this file....
Thank you Luis. That was wcolors.ch not wcolor.ch but I was able to compile it with your help. However, I now have a new linker message related to the trichedi.prg source file: "resetchrf" : unresolved external. I see
the function being used, but not declared anywhere. Any more ideas?
Sorry, don't know what that function does or where is it supposed to be located.
Luis, parece que te contaminaron, no creo que ese sea tu nombre FUCK YOU SPAMMER !!!!
))))))))))))
Mi querido hermano metio mano a mi PC así que disculpas al foro.
Class TRichEdit only works with Harbour and FWH. It is a Windows API limitation.
--------------------------------------------------------------------------------
Hello, I am very interested in using TDBF but like other single language
challenged people I can not read the history.txt
Well thanks to the web translators I converted the history.txt to an English
syntax.
I use the word convert because I did not translate it.
I hope this is helpful to the community and my apologies to the what I may
have don to the Spanish language. HISTORY.ZIP
--------------------------------------------------------------------------------