Clipper/FiveWin - Programa de notas o postic

 
Vista:

Programa de notas o postic

Publicado por Roberto Perez (1 intervención) el 23/09/2009 16:58:46
Hola,

Poseo un programa de postic o notas hecho en FIVEWIN PARA CLIPPER, pero cuando lo compile en FIVEWIN PARA HARBOURD ME muestra algunos errores, este programa aparecia como ejemplo en versiones de FIVE WIN ANTERIORES. Me gustaria saber si alguien lo tiene PARA FIVEWIN HARBOUR.

Gracias
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder

RE:Programa de notas o postic

Publicado por marcelo (161 intervenciones) el 06/10/2009 17:06:59
creo que es este.
espero te sirva.
Saludos
MArcelo
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
/*
*   Programmer: Kevin S. Gallagher
*  Description: function to mimic Microsoft's Tip of the day routine
*   CopyRights: Public Domain
*/

#include "fivewin.ch"

#define N_OK      101
#define N_NEXT    102
#define N_SHOWTIP 104

function Main()
   TipOfDay( ".\Mytips.ini" )
   ?"Place your application code here"
return nil

procedure TipOfDay(cIniFile)
   local cMessage
   local cTip := "Tip"
   local cShow
   local oDlg
   local oText
   local lNext
   local nNextTip
   local nTotals

   if !file(cIniFile) .or. empty(cIniFile)
      return
   endif

   if (Val(GetPvProfString("Options", "ShowTip","1", cIniFile))) == 0
      return
   else
      lNext := .t.
   endif

   nTotals  := Val(GetPvProfString("Total Tips","Total Tips","0",cIniFile))
   nNextTip := Val(GetPvProfString("Next Tip","TipNo","0",cIniFile))
   cTip     +=  ltrim(str(nNextTip))
   cMessage := GetPvProfString("Tips", cTip, "Error", cIniFile)

   nNextTip += 1
   if nNextTip > nTotals
      nNextTip := 1
   endif

   if nTotals < nNextTip
      WritePProString("Next Tip", "TipNo", "1",cIniFile)
   else
      WritePProString("Next Tip", "TipNo", ltrim(str(nNextTip)),cIniFile)
   endif

   if GetPvProfString("Options", "ShowTip","0",cIniFile) == "0"
      return                                          /* NOTE */
   endif

   SET RESOURCES TO "TIPSTER.DLL"
   DEFINE DIALOG oDlg  NAME "KG_TIP"

   REDEFINE CHECKBOX lNext  ID N_SHOWTIP  ;
      ON CHANGE ShowMyTip(lNext,cIniFile) ;
      OF oDlg

   REDEFINE SAY ID 200 OF oDlg

   REDEFINE BUTTON ID N_OK  OF oDlg  ACTION oDlg:End()

   REDEFINE BUTTON ID N_NEXT OF oDlg ACTION NextTip(nNextTip,cIniFile,oText)

   REDEFINE GET oText VAR cMessage ID 103 OF oDlg MEMO READONLY

   ACTIVATE DIALOG oDlg CENTERED

   if !WritePProString( "Next Tip", "TipNo",ltrim(str(nNextTip)),cIniFile)
      MsgStop("Writing to tips textfile","Internal error Tips-111")
   endif

   SET RESOURCES TO
return

static procedure NextTip(nNextTip,cIniFile,oText)
   local nTotals
   local cMessage
   local cTip := "Tip"

   nNextTip := Val(GetPvProfString("Next Tip","TipNo","0",cIniFile))
   cTip     += ltrim(str(nNextTip))
   cMessage := GetPvProfString("Tips", cTip, "", cIniFile)

   if empty(cMessage)
      cMessage := "Internal error occured #Tips-121"  // whatever...
   endif

   oText:cText := cMessage
   oText:Refresh()
   nNextTip += 1

   nTotals  := Val(GetPvProfString("Total Tips","Total Tips","0",cIniFile))

   if nNextTip > nTotals
      nNextTip := 1
   endif

   if nTotals < nNextTip
      WritePProString("Next Tip", "TipNo", "1",cIniFile)
   else
      WritePProString("Next Tip", "TipNo", ltrim(str(nNextTip)),cIniFile)
   endif
return

/*
*     Procedure: ShowMyTip()
*              :
*   Description: Toggles state of if to show tip dialog
*              :
*     Arguments: lNext
*              : cIniFile
*              :
*      Comments: If lNext == 1 means to show tips
*              :    lNext == 0 means do not show tips
*/
static procedure ShowMyTip(lNext,cIniFile)
   if !lNext
      WritePProString("Options", "ShowTip","0", cIniFile)
   else
      WritePProString("Options", "ShowTip","1", cIniFile)
   endif
return
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

es este!!!!!!!!

Publicado por marcelo (161 intervenciones) el 06/10/2009 17:08:59
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
// Programa para poner peque¤as notas en la pantalla
/*
/*
File Name  : NOTAS.PRG        Brainware Notes

Description:

              It demonstrates the use of floating windows allways
              on top. Very useful to keep anotations post-it kind
              in your desktop.

                 If you  put  it  on the Start group will mantain
              pending things allways at your sight.

              Demonstrates the power of Fivewin and its ease of use.

              I provide this file to thank you all for the tips
              downloaded from CServe in these years!

              Comments are welcome.

Author     : Fernando Chapa      104164,1417   &     75162,3247
             Eduardo Valero
             Brainware, S.C.
             We are Brainware!

Date       : 06/20/96

           : Needs Fivewin 1.9 to compile

*/
 
#Include "FiveWin.ch"
Static oGet1, oGet2, oGet3, oBut
 
Function Main()
 
/*
   Main floating window
*/
 
If !File("notas.dbf") .or. !File("notas.dll")
   return nil
Endif
mxnotas:={}
mover=.t.
mcual=""
mnuevo=.t.
Set Resources to "notas.dll"
Use notas
pack
index on numero to notas.ntx
Set Dele On
Define window Notas from 0,3 to 1.3,31 STYLE WS_POPUP
@ 0,0 BITMAP resource "bwnotas" NOBORDER OF Notas PIXEL SIZE 64,21 ON LEFT CLICK Click2() ;
      ON RIGHT CLICK Acerca()
@  0, 8 BITMAP resource "nueva" of Notas ON LEFT CLICK Nueva()
@  0, 13 BITMAP resource "mostrar" of Notas ON LEFT CLICK Act2()
@  0, 18 BITMAP resource "ocultar" of Notas ON LEFT CLICK Quitar()
@  0, 23 BITMAP resource "salir" of Notas ON LEFT CLICK Termina()
Activate Window Notas On Init (Act1(),SysRefresh(), Act2()) Valid Salir()
Set Resources to
Return nil
 
Function Salir()
Set Resources to
Close data
Return .t.
 
Func Termina()
Quitar()
Notas:End()
Quit
Return nil
 
Func Act1()
SetWindowPos(Notas:hWnd,-1,0,0,0,0,3)
Return nil
 
Func Nueva()
Go Bottom
xnum=numero+1
Append Blank
Replace numero with xnum, renglon with 200
mcual=Alltrim(Str(xnum))
Public ownd&mcual
Define Window ownd&mcual from renglon/16,columna/8 to renglon/16+6,columna/8+20 Color CLR_BLACK,CLR_YELLOW STYLE nOr(WS_POPUP,WS_BORDER) of Notas
ownd&mcual:Cargo:=mcual
ownd&mcual:bLClicked := { || Editar(ownd&mcual) }
Aadd(mxnotas,Strzero(val(mcual),4))
Activate Window oWnd&mcual on init Activa(ownd&mcual)
Return nil
 
Func Act2()
Quitar()
mnuevo=.f.
Go Top
Do while !Eof()
   mcual=Alltrim(Str(numero))
   Public ownd&mcual
   Define Window ownd&mcual from renglon/16,columna/8 to renglon/16+6,columna/8+20 Color CLR_BLACK,CLR_YELLOW STYLE nOr(WS_POPUP,WS_BORDER) of Notas
   ownd&mcual:Cargo:=mcual
   ownd&mcual:bLClicked := { || Editar(ownd&mcual) }
   Aadd(mxnotas,Strzero(val(mcual),4))
   Activate Window oWnd&mcual on init Activa(ownd&mcual)
   Skip
Enddo
Return nil
 
Func Quitar()
For i=1 to len(mxnotas)
    mcual=Alltrim(str(val(mxnotas[i])))
    ownd&mcual:End()
Next
mxnotas:={}
Return nil
 
Func Editar(xvent)
/*
   Text edition
*/
If !mover
   return nil
Endif
Public xr1, xr2, xr3
Seek Val(xvent:Cargo)
mcargo:=xvent:Cargo
If Found()
   mover=.f.
   xr1:=R1
   xr2:=R2
   xr3:=R3
   @  2.0, .5 GET oGet1 VAR xr1 of xvent SIZE 150,22
   @  3.6, .5 GET oGet2 VAR xr2 of xvent SIZE 150,22
   @  5.2, .5 GET oGet3 VAR xr3 of xvent SIZE 150,22
   @  0.5, 13 BUTTON oBut PROMPT "Ok" of xvent Action (Teredita(xvent))
Endif
Return nil
 
Func Teredita(yvent)
Replace R1 with xr1, R2 with xr2, R3 with xr3
mcargo=yvent:Cargo
oGet1:End()
oGet2:End()
oGet3:End()
oBut:End()
mover=.t.
mTexto(yvent)
Return nil
 
Func Activa(xvent)
xcargo=xvent:Cargo
@ 0,0 BITMAP resource "esquina" NOBORDER OF xvent PIXEL SIZE 80,21 ;
  ON LEFT CLICK Click(xvent)
@ 5,140 BITMAP resource "quitar" NOBORDER OF xvent PIXEL SIZE 15,15 ;
  ON LEFT CLICK Fin(xvent)
SetWindowPos(xvent:hwnd,-1,0,0,0,0,3)
mTexto(xvent)
Return nil
 
Func Click(yvent)
If !mover
   return nil
Endif
Do while GetKeyState(VK_LBUTTON)
   punto:=GetCursorpos()
   MoveWindow( yvent:hWnd, punto[1],punto[2], 160,96,.t. )
   Sysrefresh()
   If !GetKeyState(VK_LBUTTON)
      Exit
   Endif
Enddo
punto:=GetCursorpos()
seek Val(yvent:Cargo)
If Found()
   Replace renglon with punto[1], columna with punto[2]
Endif
mTexto(yvent)
Return nil
 
Func Click2()
Do while GetKeyState(VK_LBUTTON)
   punto:=GetCursorpos()
   MoveWindow( Notas:hWnd, punto[1],punto[2], 225,21,.t. )
   Sysrefresh()
   If !GetKeyState(VK_LBUTTON)
      Exit
   Endif
Enddo
Return nil
 
Func Fin(yvent)
If mover
   mcual:=yvent:Cargo
   Seek Val(mcual)
   If Found()
      If MsgYesNo(OemToAnsi("¨Desea eliminar esta nota?"),"BW Notas")
         Delete
         yvent:End()
         x=Ascan(mxnotas,StrZero(Val(mcual)))
         If x>0
            y=len(mxnotas)
            Adel(mxnotas,x)
            Asize(mxnotas,y-1)
         Endif
         Go Top
       Endif
   Endif
Endif
Return nil
 
Func mTexto(zvent)
mzcual:=zvent:Cargo
Seek val(zvent:Cargo)
If Len(Alltrim(r1))=0 .and. Len(Alltrim(r2))=0 .and. Len(Alltrim(r3))=0
   @ 2,1 SAY oSay1&mzcual PROMPT "Nota:"+zvent:Cargo of zvent
Else
   @ 2,.5 SAY oSay1&mzcual PROMPT R1 of zvent SIZE 150,22
   @ 3.6,.5 SAY oSay2&mzcual PROMPT R2 of zvent SIZE 150,22
   @ 5.2,.5 SAY oSay3&mzcual PROMPT R3 of zvent SIZE 150,22
Endif
return nil
 
Func Acerca()
MsgInfo("By Fernando Chapa & Eduardo Valero","BW Notes")
Return nil
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

es este!!!!!!!!

Publicado por marcelo (161 intervenciones) el 06/10/2009 17:11:27
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
// Programa para poner peque¤as notas en la pantalla
/*
/*
File Name  : NOTAS.PRG        Brainware Notes

Description:

              It demonstrates the use of floating windows allways
              on top. Very useful to keep anotations post-it kind
              in your desktop.

                 If you  put  it  on the Start group will mantain
              pending things allways at your sight.

              Demonstrates the power of Fivewin and its ease of use.

              I provide this file to thank you all for the tips
              downloaded from CServe in these years!

              Comments are welcome.

Author     : Fernando Chapa      104164,1417   &     75162,3247
             Eduardo Valero
             Brainware, S.C.
             We are Brainware!

Date       : 06/20/96

           : Needs Fivewin 1.9 to compile

*/
 
#Include "FiveWin.ch"
Static oGet1, oGet2, oGet3, oBut
 
Function Main()
 
/*
   Main floating window
*/
 
If !File("notas.dbf") .or. !File("notas.dll")
   return nil
Endif
mxnotas:={}
mover=.t.
mcual=""
mnuevo=.t.
Set Resources to "notas.dll"
Use notas
pack
index on numero to notas.ntx
Set Dele On
Define window Notas from 0,3 to 1.3,31 STYLE WS_POPUP
@ 0,0 BITMAP resource "bwnotas" NOBORDER OF Notas PIXEL SIZE 64,21 ON LEFT CLICK Click2() ;
      ON RIGHT CLICK Acerca()
@  0, 8 BITMAP resource "nueva" of Notas ON LEFT CLICK Nueva()
@  0, 13 BITMAP resource "mostrar" of Notas ON LEFT CLICK Act2()
@  0, 18 BITMAP resource "ocultar" of Notas ON LEFT CLICK Quitar()
@  0, 23 BITMAP resource "salir" of Notas ON LEFT CLICK Termina()
Activate Window Notas On Init (Act1(),SysRefresh(), Act2()) Valid Salir()
Set Resources to
Return nil
 
Function Salir()
Set Resources to
Close data
Return .t.
 
Func Termina()
Quitar()
Notas:End()
Quit
Return nil
 
Func Act1()
SetWindowPos(Notas:hWnd,-1,0,0,0,0,3)
Return nil
 
Func Nueva()
Go Bottom
xnum=numero+1
Append Blank
Replace numero with xnum, renglon with 200
mcual=Alltrim(Str(xnum))
Public ownd&mcual
Define Window ownd&mcual from renglon/16,columna/8 to renglon/16+6,columna/8+20 Color CLR_BLACK,CLR_YELLOW STYLE nOr(WS_POPUP,WS_BORDER) of Notas
ownd&mcual:Cargo:=mcual
ownd&mcual:bLClicked := { || Editar(ownd&mcual) }
Aadd(mxnotas,Strzero(val(mcual),4))
Activate Window oWnd&mcual on init Activa(ownd&mcual)
Return nil
 
Func Act2()
Quitar()
mnuevo=.f.
Go Top
Do while !Eof()
   mcual=Alltrim(Str(numero))
   Public ownd&mcual
   Define Window ownd&mcual from renglon/16,columna/8 to renglon/16+6,columna/8+20 Color CLR_BLACK,CLR_YELLOW STYLE nOr(WS_POPUP,WS_BORDER) of Notas
   ownd&mcual:Cargo:=mcual
   ownd&mcual:bLClicked := { || Editar(ownd&mcual) }
   Aadd(mxnotas,Strzero(val(mcual),4))
   Activate Window oWnd&mcual on init Activa(ownd&mcual)
   Skip
Enddo
Return nil
 
Func Quitar()
For i=1 to len(mxnotas)
    mcual=Alltrim(str(val(mxnotas[i])))
    ownd&mcual:End()
Next
mxnotas:={}
Return nil
 
Func Editar(xvent)
/*
   Text edition
*/
If !mover
   return nil
Endif
Public xr1, xr2, xr3
Seek Val(xvent:Cargo)
mcargo:=xvent:Cargo
If Found()
   mover=.f.
   xr1:=R1
   xr2:=R2
   xr3:=R3
   @  2.0, .5 GET oGet1 VAR xr1 of xvent SIZE 150,22
   @  3.6, .5 GET oGet2 VAR xr2 of xvent SIZE 150,22
   @  5.2, .5 GET oGet3 VAR xr3 of xvent SIZE 150,22
   @  0.5, 13 BUTTON oBut PROMPT "Ok" of xvent Action (Teredita(xvent))
Endif
Return nil
 
Func Teredita(yvent)
Replace R1 with xr1, R2 with xr2, R3 with xr3
mcargo=yvent:Cargo
oGet1:End()
oGet2:End()
oGet3:End()
oBut:End()
mover=.t.
mTexto(yvent)
Return nil
 
Func Activa(xvent)
xcargo=xvent:Cargo
@ 0,0 BITMAP resource "esquina" NOBORDER OF xvent PIXEL SIZE 80,21 ;
  ON LEFT CLICK Click(xvent)
@ 5,140 BITMAP resource "quitar" NOBORDER OF xvent PIXEL SIZE 15,15 ;
  ON LEFT CLICK Fin(xvent)
SetWindowPos(xvent:hwnd,-1,0,0,0,0,3)
mTexto(xvent)
Return nil
 
Func Click(yvent)
If !mover
   return nil
Endif
Do while GetKeyState(VK_LBUTTON)
   punto:=GetCursorpos()
   MoveWindow( yvent:hWnd, punto[1],punto[2], 160,96,.t. )
   Sysrefresh()
   If !GetKeyState(VK_LBUTTON)
      Exit
   Endif
Enddo
punto:=GetCursorpos()
seek Val(yvent:Cargo)
If Found()
   Replace renglon with punto[1], columna with punto[2]
Endif
mTexto(yvent)
Return nil
 
Func Click2()
Do while GetKeyState(VK_LBUTTON)
   punto:=GetCursorpos()
   MoveWindow( Notas:hWnd, punto[1],punto[2], 225,21,.t. )
   Sysrefresh()
   If !GetKeyState(VK_LBUTTON)
      Exit
   Endif
Enddo
Return nil
 
Func Fin(yvent)
If mover
   mcual:=yvent:Cargo
   Seek Val(mcual)
   If Found()
      If MsgYesNo(OemToAnsi("¨Desea eliminar esta nota?"),"BW Notas")
         Delete
         yvent:End()
         x=Ascan(mxnotas,StrZero(Val(mcual)))
         If x>0
            y=len(mxnotas)
            Adel(mxnotas,x)
            Asize(mxnotas,y-1)
         Endif
         Go Top
       Endif
   Endif
Endif
Return nil
 
Func mTexto(zvent)
mzcual:=zvent:Cargo
Seek val(zvent:Cargo)
If Len(Alltrim(r1))=0 .and. Len(Alltrim(r2))=0 .and. Len(Alltrim(r3))=0
   @ 2,1 SAY oSay1&mzcual PROMPT "Nota:"+zvent:Cargo of zvent
Else
   @ 2,.5 SAY oSay1&mzcual PROMPT R1 of zvent SIZE 150,22
   @ 3.6,.5 SAY oSay2&mzcual PROMPT R2 of zvent SIZE 150,22
   @ 5.2,.5 SAY oSay3&mzcual PROMPT R3 of zvent SIZE 150,22
Endif
return nil
 
Func Acerca()
MsgInfo("By Fernando Chapa & Eduardo Valero","BW Notes")
Return nil
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

RE:es este!!!!!!!!

Publicado por Roberto Perez (1 intervención) el 08/10/2009 04:13:07
Marcelo este es el programa que tengo, me funciona bIEN en FIVEWIN 2.4 PARA CLIPPER 5.2, pero en FIVEWIN PARA HARBOUR el DLL para la pantalla que tiene es de 16 bit y no funciona en FWH, le quito el DLL Y ME DA ERRORES.

Lo probaste en FWH. Agradeceria la ayuda

GRACIAS
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar