viernes, 23 de octubre de 2015

Trucos FiveWin

This comes to story for the old probervio:
-If your you have suffered for your ignorance, he/she teaches to the other ones that they don't suffer that that your, and this way you anger reducing the suffering in the world (of T.A.O.)

It is a summary of the questions and answers made to the list "fivewin-the"
during the four first months of fivewin sufridor

I have not been about making anything beautiful, but useful that occupies not very for that reason he/she goes in pure text

It is chaotic, anarchical, disordered, but if alone to one of you avoids him/her the suffering, I give for very employee the time that I have used in gathering it

if somebody the improvement, charmed, if the raisin to other, also, alone I ask that you don't erase the final part of the text that less, not?????

and beginning that it is gerund .....

1.-When we want to make that the messages of a button of an I dialogue they appear in the bar of messages of the main window..

this it is OWND; to put in the I dialogue the instructions

it defines dialog odlg. .... of ownd

acti dialog .... CENTERED  

2.-  as filtering a listbox of a database, for those records that complete a certain condition.


oLBX:SetFilter ("CAMPO_o_EXPRESION", "Valor_TOPE_del_FILTRO", "Valor_ULTIMO_del_FILTRO")
oLBX:GoTop()


3.-DLL doesn't close when there is an abnormal termination of the Program.
For that it uses:

WPS.exe

It is an utility to close DLL that are open.
or it places in your program the instruction CLIPPER

Exit Final Procedure / / this it is of clipper that you know it
   //Sep Resources / / it Liberates all the Loaded Resources
   FreeResources () / / Also but with Function (it is the same but more beautiful)
freelibrary ('miBWCC.DLL')
    //oFont:End()
Return

4.-They leave strange things when giving to the button dcho in a get... with regard to the menu popup if you can modify it, but you have to alter the class TGet.
Then you should modify the Class TGET.
Among you line them 954 and 1041 (approximately) of TGET.prg, this the method ButtonDown.
I believe that it can work putting an asterisk to it lines her 1039 (or to it lines her that he/she says:

ACTIVATE YOU POPUP oMenu AT nRow - 60, nCol OF Self

 
5.-To incrust a bmp in an I dialogue with WS
 
Do you already have BMP that "build" the button of the magnifying glass?
   What you have to make is to open Workshop 2 times, one with your DLL and another with my DLL. It copies the bellboys of my dll, and hit them in your dll, to change the bmp of the alone button you should change their you GO.
 
- He/she remembers to make SEP RESOURCES TO "MIDLL.DLL"
and hBorland:=LoadLibrary ("BWCC.DLL"), at the beginning of MAIN ().

 If your Button has the you GO 445, then him but insurance is that inside your DLL there is 2 BMP that finish in 445 at least (those they are BMP that build to the button and that they give him/her the appearances of: Normal button, pressed Button and Button with Focus). BMP will have (so that Borland works as Bellboys), to be: 1445 (bmp of the normal button), 3445 (bmp of the pressed button), and 5445 (bmp of the button with focus).
If you want to change the size of the button, you will change the size to these 3 Bmp's. (I use the bellboys a lot Borland but single use those that begin with 1 and with 3, that is to say that when my bellboys have the focus, they are come with Bmp that begins with 1 and not with 5). That is to say: It is not obligatory to use the bmp that begins with 5.
   
6.-Error when recording Dll.
 
It doesn't allow me to record .dll he/she tells me

Unexpected file format

That can fix it Recording your resources above another existent (clear, sacks a copy of a dll of another program) DLL, and later you make a rename to that DLL and you follow it using with WS.

7.- Technique of the magnifying glass 

 Objective:
1) if the user enters a code been worth, then the focus should not stop in the button of the magnifying glass.
2) if the user doesn't enter any code (content inside the chart DBF), then the button of the magnifying glass if he should acquire the focus.
3) if the user enters a missed code, (that is to say: that it is not contained inside DBF), then the button of the magnifying glass IF it should win the focus.
4) the button of the magnifying glass, it should activate other I dialogue where spreads a browse of help with the data of DBF that it contains the codes in question.



8.-To make that the icon appears in .exe; to see the icon from the explorer

You have to record an icon like file .RC, and to "incrust it" then in your exe that Blinker takes place it.
The incrustador of the icon inside the exe is RC.EXE (and BRC.EXE if you use that of the workshop).
The icon .RC generates it in the workshop.
If you incrust all your complete resources in the exe, (if you make this it is because you don't want to use DLL in time of execution), then the icon of the exe will be the first icon of the group ICON inside the resources  


9.- a problem of VmPreAlloc.
       I have the solution for your friend, tell him/her that it compiles the object that I annex you next to their other obj and resolved problem.
the obj is ALLOC.obj. ....


10.-Fonts handling
You have to change Font in your program.

LOCAL BACEPTA, OBMP, OFONT, OSAY2, OFONT2
DEPRIVE YOU OTIMER, ODLG, OSAY
FONT DEFINES OFONT YAM "MS SANS SERIF" SIZE 0, -10
FONT DEFINES OFONT2 YAM "ARIAL" SIZE 0, -20 BOLD
DIALOG DEFINES ODLG TITLE 'Transfer of NOTES OF OFFICE .....' RESOURCE 'DLG_001' FONT OFONT
BITMAP REDEFINES OBMP you GO 102 OF ODLG RESOURCE 'DMICH'
OBMP:CENTER()
SAY REDEFINES OSAY you GO 120 OF ODLG COLOR CLR_BLUE FONT OFONT2
BUTTON REDEFINES BINFO You Go 442 OF ODLG ACTION He/she Informs (M - > Author, 'Software Development')
BUTTON REDEFINES BACEPTA you GO 400 OF ODLG ACTION (ODLG:END())
OSAY:SETTEXT ('Waiting .............')
ACTIVATE YOU DIALOG ODLG CENTER ON INIT DEFINIT (ODLG)
REREAD YOU TIMER OTIMER
RETURN NIL


11.- I fail in the evaluation pile:
SOLVED

> Which the values of Heapsize and Stacksize were?
> (The Previous Ones and the New Ones) ...................
>
    stacksize of before.- 9500
    heapsize of before.- 4096

    stacksize of now.- 9500
    heapsize of now.- 8192

    Greetings.

12.-I manage of the database
The problem was in that toward a dbSelectArea ("CLIE") after making a
DATABASE oDclien and as it seems it is necessary to make it, I thought that once
open the charts you could create the object chart and later to select the
chart, but it seems to be that it is not this way. Curious truth?

13.- now I cannot load but of a DLL, it doesn't recognize me the resources of the
 second that I load.

The first time that you call to SEP RESOURCES TO... you establish DLLs
that you will use for the resources. Starting from there, you must return to
to call to SEP RESOURCES TO to select the one that you will use in each
moment:

   SEP RESOURCES TO "system\comun.dll", "system\part.dll"

now, if you will consent to resources that are in part.dll:

   SEP RESOURCES TO "system\part.dll"

Lastly, if you call to SEP RESOURCES TO without more parameters
then discharges all the DLLs of the memory.


14.-Problems with the dll without open WS
> Simple solution.
>
> When you will keep DLL you enter in the Option:
>
> Save file ace
>
> And the guards on a dll (anyone) that already exists.
> (Of course, you work on a copy).


That has already proven it and he/she tells me the same thing; unexpectec....
It recorded it on screen.dll

Good P. d.; I have copied one of those that work well!!!FOS.DLL has changed It name, and I have told him/her save ace, and WELL

IT WORKS..

AND I CHANGE HIM/HER THE SEP RESOURCES TO "FOS.DLL"

AND IT IS NO LONGER NECESSARY TO LOAD WS...



15.-Spinners
 This is a SPINNER:



It is a Get with Vertical Scroll Bar, and in the one it REDEFINES you put: SPINNER MIN X MAX AND

A Spinner is a bar of vertical scroll associated to an only get and it is good to increase or to diminish the value of the variable assigned to the get. This way, in a get with Spinner can introduce the fact manually or to press their scroll to modify it. Since the supreme spinner or it subtracts to the variable of the get, he/she only makes sense in numeric gets or of date.

16.-Problems with Ñ and ñ (mayusc. and min )
 Treatment a file .dbf that was created from Dbase Iv two in a program fivewin and clear ñ so you
they visualize as "Ñ" for what I apply OemToAnsi and orderly. But eun
díalogo of looking for for name wants that the operator types Ñ and it looks for it.

The case is that after proving several things the only form that I make that me
work it is the following one, but I don't understand BECAUSE it WORKS!

1:  Replacement in the original file the fields with Oem to Ansi

Do while .not. eof()
     letters - > letter: = OemToAnsi (letters - > letter)
     letters - > apelli: = OemToAnsi (letters - > apelli)
     letters - > it names: = OemToAnsi (letters - > it names)
     letters - > apenom: = OemToAnsi (letters - > apenom)
     skip
enddo

2.- I believe the index using AnsiToOem
 BuildIndex (oMeter, oText, oDlg, @ lEnd, "AnsiToOem (Letters - > Apenom)",
"AAPENOM" ) },;
          "Indexing base of Taxpayers without codes", "Wait a
moment" )

3.- The ListBox has to apply him/her: AnsiToOem
@ 1, 1 LISTBOX oLbx FIELDS
AnsiToOem (Letters - > letter), AnsiToOem (Letters - > apenom), STR ((Letters - > level) ,2);

4.- To the get I don't make him/her any conversion:
if MsgGet (to "LOOK FOR", "Last names.:", @ cApenom,;
              "lupa.bmp" )
      cClave: = Upper (cApenom)

For sure it is easier than all this, but it works!!!




17.-taenia a small function that showed in screen a text and it displaces it from izq to der and of
 up to below, this uses it to dress to the program nothing else but
I have the restlessness you this one can make and I eat,

In it paginates it of Ramón Avendaño you have the Class DSay That makes it exactly
that your you want.
http://personales.mundivia.es/rar/fivewin.htm



>
18.-In connection with the topic of the resources:
1) SCREENS.DLL that comes with FW 2.0 pretends to already have some problem
that I could never add him/her resources. The only solution to begin with
Empty DLL was to take a 'borrowed' that worked and to erase him/her all the
resources. 
2) the other form of using resources, incrusting them in .EXE, you
it can sum up for the method that BUILD.BAT teaches or, according to
I discovered in BLINKER 5.1 to add in the link script the command RC
RECURSO.RES
you are right, to my An even sends me Lin a screen.dll
empty and he/she doesn't go, you cannot record anything in her

I believe that the reason for which goes when you add him/her resources to a full one it is
because they have something but, empty a good one, and when opening it with Sep resources
I opened up her alone the ct3dv2 (or something like that)
putting the resources by means of a rc and telling him/her to record as fos.dll
(llenita) he/she told me that it already existed, me the sobreescribia with my resources and
voilá!!  alone they are my resources and the other thing (mystery)


19.-We all have the prg calendar that he/she comes in samples
You put it alone and it works, I call it from my routine and anything, neither with
parameters neither without parameters,

Compile it and you call it from your program with Winexec ("calendar")
to have if it works this way you. and it works!!!1

20.-instead of Run you Have to use the function of FiveWin WaitRun()
But he/she has some strange things...
if you want that he/she appears you the possible message of the window and that this he/she doesn't close
you use it to hair "
WaitRun ('miprog')
But if quuieres that alone it executes it to you and later you comes out, easy, (when one knows)
WaitRun ('command.com /c miprog')


21.- Static variables This because a friend from Brazil wondered envelope for that of his GPF in a great application The problem was in STATIC. The friend used variable many STATIC for PRG, thing that FW supports in smaller quantity regarding MSDOS. Equally NEVER serious necessary to write but of 1 variable for I modulate PRG, let us see the example:

It is not convenient to make this!!!!!!!!
STATIC aVar
STATIC bVar
STATIC cVar
STATIC dVar


This should be made!!!!!!!
STATIC aArrayVars: = {Nil, Nil, Nil, Nil}
#xtranslate aVar = > aArrayVars \ [1 \]
#xtranslate bVar = > aArrayVars \ [2 \]
#xtranslate cVar = > aArrayVars \ [3 \]
#xtranslate dVar = > aArrayVars \ [4 \]

In fact with this we define 1 variable STATIC and we consume less the resources of the system, and this solution AVOIDS to modify the code of PRG, except the initial definition, and him but important EVITA GPF!!! Some will say that it is the same thing to put #it defines, BUT it IS NOT THE SAME thing!!!!!!!!, since these you are defined they don't solve when they incorporate in COMMANDS, thing that if it solves #xtranslate. :-)

    Now regarding PUBLIC. It is also convenient to use 1 (ONE) variable in the whole system. ...... Siiiiiiiiiiii is well also amarretes and greedy persons for the use of these, and we will avoid headaches and conflicts!!!!! Supognamos that we have the following variables:

PUBLIC cSistema: = "System Pepe"
PUBLIC cPath: = "\Datos"
PUBLIC cCopyright: = I "Collide Gigio Systems"

....... NOT NOT AND NOT!!!!! NON DEBEBMOS TO MAKE THIS!!!!!

We should make this another:

Function Main()
    PUBLIC oApp: = TApplication()
.......

return nil

CLASS TApplication
   It DATES cSistema INIT "System Pepe"
   It DATES cPath INIT "\Datos"
   It DATES cCopyright INIT I "Collide Gigio Systems"
    ........... and this way all those that we wanted!!!!! :-)
ENDCLASS

........... and like it is an object I publish we will be able to modify their instance variables when you we of the one given win!!!!! and we have 1 single public, bony oApp in object form and we would consent this way
    Alert (oApp:cCopyright)!!!!!!!!!! it is very easy!!!!!!!!!!!!!!!!!


    The shift arrives of the you DEPRIVE YOURSELF, it is convenient not to USE THEM we always use the LOCAL one and pasemolas for reference. We could also use a LOCAL I object TARRAY and this it is good us to pass arguments hundred of varialbes in 1 alone. OLVIDEMONOS qure exists the you DEPRIVE YOURSELF!!!!!
   
    CONCLUSION: If we optimize the code of an application we will achieve:

1) bigger speed
2) bigger resursos readiness
3) smaller errors GPF (they will be almost impossible of visualizing)
4) a code but readable



22.- A very good form of arming all the controls is to put him/her the clause UPDATE
This way you make the changes of the variables and single tenes that to make oDlg:update()
and I list he/she refreshes all the I dialogue.





23.- so that you cannot publish the get you should put the condition WHEN .F.

24.-as putting color to the static text?


> Dear friends like one makes to put color to the static generated text
> from Work Shop. Can one make from code?
> At the moment for SAY it REDEFINES them I use
> SAY oMunicipi REDEFINES VAR cCMunici you GO 122 OF Odlg UPDATE;
>    COLOR RGB (000,000,255), RGB (255,255,255)
>
> But if I generate a head text to the field from Work Shop not you
> to change him/her the color. Is it possible?

You make it from a same way to the example that you sent, alone you make sure that the one
text doesn't have you GO -1 but a you GO been worth.

25.-ENTER behaves like in Clipper-DOS.

If to you you are not behaved this way, then he/she enters to WS, and in the dialogues, him
you put to each button (in their properties), PUSH BUTTON instead of DEFAULT PUSH
BUTTON.

26.-checkbox.
 If you want that a logical variable changes state you don't use:
if (vclival=.t.,vclival:=.f.,vclival:=.t) it is but easy and but I clean to use:
vclival: =!vclival, this way forgets the questions.... ;)
2) the vclival value changes depending on the checkbox state. .... I don't see
so that you change it vos in the program.
PS: You have a VERY SIMPLE example IN SAMPLES\TESTCHCK.PRG

the error seems to be in that the variable vClival
it is changed alone, and if your in the program changes it, then
it returns to the same thing.

attempt this way it:

ON CLICK (TO CHANGE ('CLIENTS', 'CLI_VAL', IF (VCLIVAL, 'IF', 'NO') ) )



27.- > Matter: [fivewin-the] somebody knows about some agent type dbu for windows
> that it uses cdx??
>Prometheus of Daniel Andrade (Free)
http://www.dbwide.freeservers.com/


28.-Alignment in the numeric gets
In it paginates it of René Flores (Cibertec) a tips section he/she comes for
fivewin. I have descended several, I recommend it to you to all
According to TO THE, the solution was: besides telling him/her right alignment, the one
to declare the get like multilinea
He/she doesn't have logic but it works. before it was hideous
Publishing the I number it leaves well, with the comma and other


29.-Here addresses go where you prune to get manuals and information in
general on FiveWin.
http://Olivares2000.WebHostMe.com/ Group Olive groves 2000
http://here.as/FiveWin/ Patrick Mast's FiveWin Page
http://start.at/edf "E.D.F" of Tricks
http://members.tripod.cl/fivewin chili Fivewinweros
http://personales.mundivia.es/rar/
http://teleline.terra.es/personal/ravendano/SOBREFW.HTM Has more than enough FiveWin
http://users.fast.co.za/~georgem/ George's Little Web Page
http://www.aglsl.com/cincowin/ Five Win, the house of the one
programmer in Fivewin
http://www.aulaware.com/ FiveWin
http://www.ciber-tec.com/ Cibernética and
Tecnología, CORP. of C.V Home Page
http://www.come.to/manuales
Http://www.eclipse.com.mx/web/fivewin/ Directory of / web / fivewin/
http://www.fivetech.com/ Fivetech: Xbase technology
http://www.grafxsoft.com/ GrafX Software CA Microsoft
Imprise Development Tools
http://www.htcsoft.freeservers.com/ htcsoft
http://www.olsonsoft.co.nz/ The Olson Software Web Site
http://ourworld.compuserve.com/homepages/jbott James Bott -
Intellitech - Computer Consulting for Small Business
http://www.argcon.net/manual5w/ is a recently gone up manual

In my place you also prune to lower a generator of applications, WiseCoder.
(This in development)
My place: http://www.citynet.com.ar/verger/wisecoder.htm

30.-Problems with printer
when the operator requests a listing, I generally put him/her
printersetup () so that it can select printer, paper or what was,
I think that the Button to cancel is not to Cancel" the impression, but it stops
To cancel the action of having taken another paper type, or another printer, in
the one dialogues of Printersetup ().
I make this way it:
An I dialogue of capture of data (the range of dates), with 3 bellboys:
A button OK (that shoots the impression)
Another button Setup that Printersetup () will shoot (but without
to print).
And another Button of Canceling (this if it cancels the listing).
If the user wants to change the size of the paper, for example; then
1ero. Setup pulses. After changing, the program presents him/her the one again
I dialogue previous, and OK pulses to print.

:

31.-But on static
    Yes that works: I already know that executable sentences cannot be placed
outside of the functions or procedures. The solution for a static variable
external it is the following one:

static aArrayVars

FUNCTION Main()

      DEFAULT aArrayVars: = Array (30 )

RETURN NIL

32.-The dialogues are not come created in WS.
I neither could read the I dialogue 12 (the 9 if I saw it well), and that made it was
to export it
to DIAL12.RC (resource / save resource ace /) and it publishes it with a text editor
and I gave myself
It counts that he/she brought a control VBX, it removes it, and then it cares him (FILE / ADD TO
PROYECT)
but before, change him/her the name of the resource (DIALOG_12 in .RC) so that not
repeat in your DLL.


33.-PROCESOR TABLE OVERFLOW. .....

> I am blocked in an I modulate of having indexed that taken out of the application and fact
> separated it works perfectly, indexing until the end has Already put him/her
> sysrefresh () for all the places and anything ....

These compiling with 5.2? If it is this way it is about linkear with ALLOC.obj. ....

> When compiling one of the prg he/she gives me memory overboked, but I compile it with lh
> clipper... and although he/she gives the error you doesn't come out, it continues until the one
> final ---

Some colleagues recommended not to use LH clipper, the reason is that it annuls
the message but continuous east!!  :((((


You have tripped yourself with the nightmare of most: PROCESOR TABLE
OVERFLOW. .....
Solution: There is not her.
The only solution is to remove the head files * .ch that you don't go to
to use.
As for example: Of fivewin.ch it removes:
OBDC.ch, DDE.ch, Tree.ch (if you don't use trees), etc.
And put: the #INCLUDE FIVEWIN.ch of I finish in each prg. ..................

> I have proven to recompilar with 5.3 and horror!!! the preprocesor table overflow
> that there was logado to remove by heart with a better handling of the variables,
> they return in all the modules, it negotiates worse the one preprocessed there is some
it forms
> of increasing him/her the memory of having preprocessed???

In 5.2 there is a lot but probability that this doesn't happen.
That is one of the reasons for which I continue using 5.2e.

Tenes that to eliminate Chs that you don't use, as placing these definitions
before FIVEWIN.CH, this the flame and this it is the form of annulling those
calls.

Another thing:
I recommend you that you arm prgs where they require calls you specify together.
For example:
impre.prg / / I defined this you work to print
this alone way here nesesitas for example REPORT.CH, and in the other ones not!!


34.- The problem also happened me.
the problem not you if it solves it but the dialogues are believed...

when it used for example the one

SEP RESOURCE TO "ELARCHIVO.DLL"
he/she always gave me the problem, but when I made it this way

SEP RESOURCE TO "C:\PROGRAMAS\...\ELARCHIVO.DLL"

it began to work, strange, if it indicated him/her the whole route it works and if
I don't give it to him the problem it arises.


35.-DLL's When changing of it schemes, tenes that to copy bwcc.dll to the directory
\windowsDir\system, is not necessary that you have it in another place.
You also have to have in that dir. ctl3d.dll, the one that comes with FW.
If tenes problems, it can be that some this with problems.

SEP RESOURCES TO
 loadlibrary ("bwcc.dll")
SEP RESOURCES TO "MENU.DLL"

36.-Handling of sources >
> @ 7, 13 Paid CHECKBOX PROMPT to "Pay & it Cares" ;
>         OF oDlg

it proves this:

        Pagado:SetFont (oWnd:oFont)

or even this another:

        Pagado:SetFont (oDlg:oFont)

Does the one define by the way, of the oDlg the referenciastes to the oWnd? That is to say him
you made similar to this:

DIALOG oDlg DEFINES OF oWnd

Otherwise I believe that the oDlg doesn't take as oFont that of the oWnd.

37.-filters inside your indexes (scopes)
you can use the clause Select of the command @... ListBox, the one which you
he/she allows to make filters
inside your indexes (scopes). It is something as :

@ 1,1 ListBox oLbx ;
FIELDS Clients - > It Names, Clients - > Debt ;
HEADERS "Names", "Debt" ;
FIELDSIZES 100,400 ;
SELECT Names FOR "America" TO "Pedro"
OF oDlg

38.- And one of the best...
Fivewin didn't work 2.0; he/she said that it lacked a function
I go to fivewin.lnk change the search for lib and!work!!!
That is to say that it is sometimes necessary to make the opposite of what you/they say. ....

39.- Trucar the valid.
In a routine of I calculate I need to make some calculations with some numeric gets; the on change doesn't work, the valid "is not worth" since I cannot use parameters; solution, intermediate, to use parts of one and another:

  GET gDIV_LITOT REDEFINES VAR vDIV_LITOT you GO 122 OF odlg PICTure "@ AND 99.999999" update READONLY / / for the result


   GET gDIV_LIRAS REDEFINES VAR vDIV_LIRAS you GO 102 OF odlg valid (vDIV_LITOT: = vDIV_LIRAS / vDIV_LICAM, odlg:update (), .t. ) // operation
notice .t. after update ()!!  This is the trick!!!
You can use valid with commands, without functions

   
*************** RESPECT THIS, PLEASE **********************************
Main authors of these tricks:
Juan José Machado. José Enrique Serrano Foundling, Fabián Acevedo, Antonio Linares, Luciano Cedrés, Hernán, Marcelo Montenegro, Martin Gómez Reyes, Guillermo Verger
Eduardo Rizzolo, Félix Pablo Big Fields, Fredy, The Full

and many but... Me alone I have limited myself to ask things and to pick up them
Angel Martin (Bilbao.-Spain)

No hay comentarios:

Publicar un comentario