topic
stringlengths 1
63
| text
stringlengths 1
577k
⌀ |
---|---|
A reason a existing post is -moved- ?
|
Uwe,It was just moved to the utilities section of these forums, as it is not specifically related to FiveWin programming.
|
A reason a existing post is -moved- ?
|
Antonio,thank you very much for the information.In the future, i will consider this.A question : In the moment, i'm busy to create a source-generator.You get a complete basic-structure of : MDI, handling of dialogs and folders, Buttonbars and browsers with all color-settings and so on.All tools like creating Backgrounds for windows / dialog, xBrowse,Buttonbars, dialog-titles will be included in just 1 Application.The settings of the different selections are stored in a database( each record will be a project like in the xbrowse-tools )There will be a part for selecting folder-colors / brushes added as well.This application is a mixture of tool and programming.Where must i put it, when it is finished ?RegardsUwe <!-- s:lol: --><img src="{SMILIES_PATH}/icon_lol.gif" alt=":lol:" title="Laughing" /><!-- s:lol: -->
|
A reason a existing post is -moved- ?
|
FiveWin related questions, source code, specific utilities, etc. are fine in this section.Generic utilities are for the utilities sectionOff Topic is for Off Topic issues <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
|
A report-sample of a imagelist with memos from DBF ?
|
Hello,
I need a REPORT-sample of a Image-list with MEMOS.
The images are adjusted to a given width ( keeping ratio )
and the row height to a given image-height if the memolines less this value
or using the maximum height of the memos INFO1 - 3
[b:lapr3nlc]Any sample exists ?[/b:lapr3nlc]
The DBF-structure :
IMAGE C 25
INFO1 M 10
INFO2 M 10
INFO3 M 10
[img:lapr3nlc]http://www.pflegeplus.com/pictures/imglist.jpg[/img:lapr3nlc]
STATIC FUNCTION PRINT_ST1()
LOCAL oReport, aImgList := {}
DBSELECTAREA("STYLE1")
Maxbe printing with a defined Image-array ?
DBGOTOP()
I := 1
DO WHILE !EOF()
AADD( aImgList, STYLE1->IMAGE )
DBSKIP(+1)
ENDDO
DBGOTOP()
REPORT oReport TITLE "*** IMAGES STYLE 1 ***","" PREVIEW ;
FONT oFONT2
[color=#FF0000:lapr3nlc][b:lapr3nlc]????? IMAGES[/b:lapr3nlc][/color:lapr3nlc]
COLUMN TITLE "Info 1" DATA STYLE1->INFO1 SIZE 15 MEMO
COLUMN TITLE "Info 2" DATA STYLE1->INFO2 SIZE 15 MEMO
COLUMN TITLE "Info 3" DATA STYLE1->INFO3 SIZE 15 MEMO
END REPORT
ACTIVATE REPORT oReport
RETURN NIL
Best Regards
Uwe <!-- s:?: --><img src="{SMILIES_PATH}/icon_question.gif" alt=":?:" title="Question" /><!-- s:?: -->
|
A report-sample of a imagelist with memos from DBF ?
|
[code=fw:151g8774]<div class="fw" id="{CB}" style="font-family: monospace;">DBGOTOP<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br />REPORT oReport <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"*** IMAGES STYLE 1 ***"</span>,<span style="color: #ff0000;">""</span> PREVIEW ;<br /><span style="color: #0000ff;">FONT</span> oFONT2<br /><br />COLUMN <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"Image"</span> <span style="color: #00C800;">DATA</span> STYLE1->IMAGE <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">20</span> <span style="color: #0000ff;">IMAGE</span><br />COLUMN <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"Info 1"</span> <span style="color: #00C800;">DATA</span> STYLE1->INFO1 <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">15</span> MEMO<br />COLUMN <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"Info 2"</span> <span style="color: #00C800;">DATA</span> STYLE1->INFO2 <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">15</span> MEMO<br />COLUMN <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"Info 3"</span> <span style="color: #00C800;">DATA</span> STYLE1->INFO3 <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">15</span> MEMO<br /><br />END REPORT<br /><br /><span style="color: #0000ff;">ACTIVATE</span> REPORT oReport<br /> </div>[/code:151g8774]
|
A report-sample of a imagelist with memos from DBF ?
|
Rao,
thank You very much for the sample.
I noticed a some things.
1. Image-Quality ?
2. big images doesn't fill the given size. They are adjusted to the memolines.
Maybe adding empty lines to fill the defined image-area ?
3. maybe something wrong with the pagebreak ?
[img:q3wyu5lq]http://www.pflegeplus.com/pictures/imglist2.jpg[/img:q3wyu5lq]
Best regards
Uwe <!-- s:?: --><img src="{SMILIES_PATH}/icon_question.gif" alt=":?:" title="Question" /><!-- s:?: -->
|
A report-sample of a imagelist with memos from DBF ?
|
1. Image height:
If we do not specify the minimum height for the image column, image size is adjusted to the maximum of other columns' memolines, subject to a minimum of 4.
We can also specify minimum height of the image in number of lines or number of pixels
COLUMN ............... IMAGE HEIGHT n // n data lines
COLUMN ............... IMAGE HEIGHT n PIXEL // n pixels height.
2. Image width: You know we can specify the width too.
3. Image is resized, retaining the aspect, to fit within the above width and height and centerd.
4. Quality: I found good quality output while actually printing on a good color printer with good resolution.
5. Last line at page-break:
I did not notice this before. We need to review.
|
A report-sample of a imagelist with memos from DBF ?
|
Thank You very much for the infos.
With a given HEIGHT, it looks much better.
With some more tests, I noticed the problem with the image / memo - combination.
Maybe some calculations needed to force a pagebreak,
if the image of the last row > the last row with memo ?
The 2 screenshots are showing the result :
[img:2otd81m2]http://www.pflegeplus.com/pictures/imglist3.jpg[/img:2otd81m2]
Memo of image 4 is splitied without showing the image .
[img:2otd81m2]http://www.pflegeplus.com/pictures/imglist4.jpg[/img:2otd81m2]
I added some lines to the memo of image 4, but no difference ( screenshot 1 ) :
[img:2otd81m2]http://www.pflegeplus.com/pictures/imglist6.jpg[/img:2otd81m2]
Best Regards
Uwe <!-- s:?: --><img src="{SMILIES_PATH}/icon_question.gif" alt=":?:" title="Question" /><!-- s:?: -->
|
A report-sample of a imagelist with memos from DBF ?
|
I see that handling of image painting at page-breaks need improvement.
We shall attend to this issue in the next release.
Thanks for bringing it up.
|
A sample FWH-XHARBOUR-MYSQL?
|
Dear friends:
Can somebody post a small sample about how use fields names on variables?
Something like this:
cField := "FIELD1"
oServer:Query("INSERT INTO MyTable ( '"+ cField + "') VALUES ('"+ cField + "' + '100.00') ,")
I got: Sintaxis error near FIELD1.
Thanks in advance.
|
A sample FWH-XHARBOUR-MYSQL?
|
Hi Francisco,
I do not understand the use of cField in the final part of your query if you want to insert a row (append). Try:
[code=fw:3v1a6wpu]<div class="fw" id="{CB}" style="font-family: monospace;">Query<span style="color: #000000;">(</span><span style="color: #ff0000;">"INSERT INTO MyTable ("</span> + cField + <span style="color: #ff0000;">") VALUES ('100.00')"</span><span style="color: #000000;">)</span></div>[/code:3v1a6wpu]
|
A sample FWH-XHARBOUR-MYSQL?
|
Hi, ADutheil . Thanks for your reply.
Yes, your are right.
[code=fw:luq4wwvn]<div class="fw" id="{CB}" style="font-family: monospace;">Query<span style="color: #000000;">(</span><span style="color: #ff0000;">"INSERT INTO MyTable ("</span> + cField + <span style="color: #ff0000;">") VALUES ('100.00')"</span><span style="color: #000000;">)</span></div>[/code:luq4wwvn]
But the error still showing. MySQL recognizes the value of the variable, but always shows the syntax error.
For example, SQLyog gives the same error in this sample;
[code=fw:luq4wwvn]<div class="fw" id="{CB}" style="font-family: monospace;">SET @c = <span style="color: #ff0000;">'FIELD1'</span>;<br />INSERT INTO mitable <span style="color: #000000;">(</span>@c<span style="color: #000000;">)</span> VALUES <span style="color: #000000;">(</span><span style="color: #ff0000;">'100.00'</span><span style="color: #000000;">)</span> ;</div>[/code:luq4wwvn]
Is there other idea?
|
A sample FWH-XHARBOUR-MYSQL?
|
Try
[code=fw:1nt4xzhj]<div class="fw" id="{CB}" style="font-family: monospace;">Query<span style="color: #000000;">(</span><span style="color: #ff0000;">"INSERT INTO MyTable ("</span> + cField + <span style="color: #ff0000;">") VALUES (100.00)"</span><span style="color: #000000;">)</span></div>[/code:1nt4xzhj]
EMG
|
A sample FWH-XHARBOUR-MYSQL?
|
Enrico, your are great...!!!
It's working!
I had tried a thousand ways and never occurred to me to enter the numeric value without quotes.
Thank you very much.
Best regards
|
A sample for building CDX-Files w. Syntax-Check
|
#include "FiveWin.ch"
// Your SOFTWARE.exe
c_dir := GetModuleFilename(GetInstance(),"SOFTWARE.EXE" + ;
CHR(0), 255)
c_pfad := left ( c_dir, rat( "\", c_dir) -1 )
REQUEST DBFCDX
RDDSETDEFAULT( "DBFCDX" )
DBFARRAY := {}
// FIELDS DBCREATE("PRODUKT"
// --------------------------------------------
AADD(DBFARRAY, { "PRODUKT", "C", 60, 0 })
AADD(DBFARRAY, { "LEISTART", "C", 1, 0 })
AADD(DBFARRAY, { "LEISTNR", "N", 2, 0 })
DBCREATE("&c_pfad\PRODUKT.DBF", DBFARRAY, "DBFCDX", .t. )
CLOSE DATABASE
// Delete Old Index
// ----------------------
DELETE FILE "&c_pfad\PRODUKT.CDX" // Indexname = DBFname,
// Two Index-Files in One ( Compound )
// INDEX SAMPLES :
// ------------------------
// ORDCREATE( ,"PRODUKT","LOWER(produkt)", ;
// {|| LOWER(produkt) } , .T. ) // UNIQUE ( .T. )
//
// Needed together
// ---------------------
// ORDCONDSET( , , , , , , , , , , .T. ) // DOWN-index
// ORDCREATE( ,"PRODUKT","STR(leistnr)", ;
// {|| STR(leistnr) } , .F. )
//
// Has to be LOWER !! because of seek => ÄÖÜ
// Use your Network-Function !!
// ----------------------------------------
if NET_USE(c_pfad + "\PRODUKT.DBF",3,5,.f.)
// Creates a Compound-Index when => ORDCREATE( ,"........
// The Index will be open together with the DBF
ORDCREATE( ,"PROD1","LOWER(leistart) + str(leistnr) ;
+ str(produkt_nr)", ;
{|| LOWER(leistart) + str(leistnr) + ;
str(produkt_nr) } , .F. )
// Extra CDX-File
// ORDCREATE( "PRODUKT1" ,"PROD1","LOWER(leistart) + ;
str(leistnr) + str(produkt_nr)", ;
// {|| LOWER(leistart) + str(leistnr) + str(produkt_nr) } , .F. )
ORDCREATE( ,"PROD2","LOWER(produkt)", ;
{|| LOWER(produkt) } , .F. )
endif
// Selects Index-Information
//----------------------------------
TERMARRAY := {}
// Contents of the Compound-Index
// -------------------------------------------
AADD(TERMARRAY, ;
{ LTRIM(STR(ORDNUMBER("PROD1"))), ;
ORDBAGNAME(1), ORDNAME(1), ORDKEY(1), ;
IIF(ORDISUNIQUE(1), "UNIQUE"," "), ORDFOR(1), ;
IIF( ORDDESCEND(1,ORDBAGNAME(1)), "DOWN", "UP") } )
AADD(TERMARRAY, ;
{ LTRIM(STR(ORDNUMBER("PROD2"))), ;
ORDBAGNAME(2), ORDNAME(2), ORDKEY(2), ;
IIF(ORDISUNIQUE(2), "UNIQUE"," "), ORDFOR(2), ;
IIF( ORDDESCEND(2,ORDBAGNAME(2)), "DOWN", "UP") } )
SHOW_CDX()
RETURN( NIL )
//------ For Control ==> Is shown only, when the index is OK -----
FUNCTION SHOW_CDX()
local oDlg10, oBrw
DEFINE DIALOG oDlg10 FROM 2, 2 TO 20, 105 TITLE "Infos about FOXPRO-CDX-Index"
@ 0.5, 0.5 LISTBOX oBrw ;
FIELDS "", "", "", "", "", "", "" ;
HEADERS "Order", "Prim.-Index", "Sec.-Index", "Expression", "Equal", "Filter", "Up / Down" ;
FIELDSIZES 40, 70 , 70, 300, 52, 190, 60 ;
OF oDlg10 SIZE 400, 100
oBrw:nAt = 1
// use more Array-elements if needed.
// ----------------------------------------------
oBrw:bLine = { || { TERMARRAY[ oBrw:nAt ][ 1 ], ;
TERMARRAY[ oBrw:nAt ][ 2 ], ;
TERMARRAY[ oBrw:nAt ][ 3 ], ;
TERMARRAY[ oBrw:nAt ][ 4 ], ;
TERMARRAY[ oBrw:nAt ][ 5 ], ;
TERMARRAY[ oBrw:nAt ][ 6 ], ;
TERMARRAY[ oBrw:nAt ][ 7 ] } }
oBrw:bGoTop = { || oBrw:nAt := 1 }
oBrw:bGoBottom = { || oBrw:nAt := Eval( oBrw:bLogicLen ) }
oBrw:bSkip = { | nWant, nOld | nOld := oBrw:nAt, ;
oBrw:nAt += nWant,;
oBrw:nAt := Max( 1, Min( oBrw:nAt, Eval( oBrw:bLogicLen ) ) ),;
oBrw:nAt - nOld }
oBrw:bLogicLen = { || Len( TERMARRAY ) }
oBrw:cAlias = "Array" // Just put something
// Vert / Hor
@ 6.3, 25 BUTTON "&Exit" OF oDlg10 SIZE 80, 18 ;
ACTION ( oDlg10:End() )
ACTIVATE DIALOG oDlg10 CENTERED
RETURN( NIL )
|
A sample how to create a IMAGE-ani. ( indexbuilder ) UPD.
|
Hello,
Different to the button-solutions, another sample shows, how to create a [color=#FF0000:16p1wq8n]IMAGE[/color:16p1wq8n]-ANIMATION
using different frames selected from a DLL ( a progressbar is embedded and is running the same time )
Frames / images are extracted from selected animated gifs and stored inside a DLL.
The animation stops on button-action or at the end of the running progressbar.
The included DLL includes 3 different animation-styles ( size 128 x 128 )
<!-- m --><a class="postlink" href="http://www.service-fivewin.de/DOWNLOADS/Animat1.zip">http://www.service-fivewin.de/DOWNLOADS/Animat1.zip</a><!-- m -->
[img:16p1wq8n]http://www.service-fivewin.de/images/Imageani1.jpg[/img:16p1wq8n]
3 different styles are included inside the DLL
[img:16p1wq8n]http://www.service-fivewin.de/images/Animat3.jpg[/img:16p1wq8n]
best regards
Uwe <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D -->
|
A sample how to create a IMAGE-ani. ( indexbuilder ) UPD.
|
Many year ago Paco made a animation class
|
A sample how to create a IMAGE-ani. ( indexbuilder ) UPD.
|
Silvio,
I don't want to create something new.
I have been looking for a solution, to replace the usage of a ANIMATED.gif
because I noticed some problems like transparent-display.
Instead I'm using a DLL with the included / extracted Gif-frames.
I searched for -> Paco, but couldn't find any post.
regards
Uwe <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D -->
|
A sample how to create a IMAGE-ani. ( indexbuilder ) UPD.
|
simply fantastic <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D -->
thanks
Uwe
|
A sample how to create a IMAGE-ani. ( indexbuilder ) UPD.
|
a practical usage creating a indexbuilder :
showing a running [color=#0000FF:1fzfbdsm]IMAGE[/color:1fzfbdsm] ( frames are defined inside a DLL )
and using [color=#0000FF:1fzfbdsm]METEREX[/color:1fzfbdsm]
DOWNLOAD :
<!-- m --><a class="postlink" href="http://www.service-fivewin.de/DOWNLOADS/Animat2.zip">http://www.service-fivewin.de/DOWNLOADS/Animat2.zip</a><!-- m -->
extra START- and END-image
[img:1fzfbdsm]http://www.service-fivewin.de/images/Animat5.jpg[/img:1fzfbdsm]
[img:1fzfbdsm]http://www.service-fivewin.de/images/Animat4.jpg[/img:1fzfbdsm]
please check / add if the index-break is defined
( needed for button < STOP ani > )
during building the index, it is possible to change the animation-style
You can remove the value or adjust the speed :
[color=#0000FF:1fzfbdsm]Sleep( 300 ), [/color:1fzfbdsm]; // added to slow down !!!
ORDCONDSET( ; // <cForCondition>
; // <bForCondition>
, .T. ;// <lAll>
[color=#0000FF:1fzfbdsm][b:1fzfbdsm], { || lRun = .T. } [/b:1fzfbdsm];[/color:1fzfbdsm] // <bWhileCondition> break if lRun = .F. on button-action
...
...
regards
Uwe <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D -->
|
A sample how to create a IMAGE-ani. ( indexbuilder ) UPD.
|
Updated
check the relationship ( animation-speed ) with combinations of delay and steps
DOWNLOAD :
<!-- m --><a class="postlink" href="http://www.service-fivewin.de/DOWNLOADS/Animat3.zip">http://www.service-fivewin.de/DOWNLOADS/Animat3.zip</a><!-- m -->
[img:244fvm1s]http://www.service-fivewin.de/images/Animat6.jpg[/img:244fvm1s]
regards
Uwe <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D -->
|
A sample how to create a IMAGE-ani. ( indexbuilder ) UPD.
|
on this forum I found this :
[url:2tbtr1uz]http://forums.fivetechsupport.com/viewtopic.php?f=17&t=12423&hilit=animation+bmp#p62341[/url:2tbtr1uz]
[code=fw:2tbtr1uz]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">Function</span> Animate<span style="color: #000000;">(</span>cResource<span style="color: #000000;">)</span> <br /><br /><span style="color: #00C800;">local</span> oDlg,lOk <br /><br /><span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">FROM</span> <span style="color: #000000;">10</span>, <span style="color: #000000;">20</span> <span style="color: #0000ff;">TO</span> <span style="color: #000000;">18</span>, <span style="color: #000000;">65</span> <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"Testing Animation"</span> <br /><br />@ <span style="color: #000000;">3.5</span>, <span style="color: #000000;">2</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #ff0000;">"&Ok"</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">35</span>, <span style="color: #000000;">12</span> <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">(</span> oDlg:<span style="color: #000000;">End</span>, lOk := .t. <span style="color: #000000;">)</span> <span style="color: #00C800;">DEFAULT</span> <br /><br /><span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">CENTERED</span> <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">INIT</span> Startup<span style="color: #000000;">(</span>oDlg,cResource<span style="color: #000000;">)</span> <br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span> <br /><br /><br /><span style="color: #00C800;">Function</span> Startup<span style="color: #000000;">(</span>oDlg,cResource<span style="color: #000000;">)</span> <br /><br /><span style="color: #00C800;">local</span> oTmr,oBmp,nFrames,nFrameWidth <br /><br />@ <span style="color: #000000;">2</span>, <span style="color: #000000;">20</span> BITMAP oBmp <span style="color: #0000ff;">RESOURCE</span> cResource <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">0</span>,<span style="color: #000000;">0</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg NOBORDER <br /><br />oBmp:<span style="color: #000000;">SetColor</span><span style="color: #000000;">(</span>GetSysColor<span style="color: #000000;">(</span> COLOR_BTNFACE <span style="color: #000000;">)</span>,GetSysColor<span style="color: #000000;">(</span> COLOR_BTNFACE <span style="color: #000000;">)</span><span style="color: #000000;">)</span> <br /><br />nFrames := val<span style="color: #000000;">(</span><span style="color: #0000ff;">right</span><span style="color: #000000;">(</span>cResource,<span style="color: #000000;">2</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span> <br /><br />nFrameWidth := oBmp:<span style="color: #000000;">nWidth</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>/nFrames <br /><br />oBmp:<span style="color: #000000;">lTransparent</span> = .t. <br /><br />MoveWindow<span style="color: #000000;">(</span>oBmp:<span style="color: #000000;">hWnd</span>,<span style="color: #000000;">2</span>,<span style="color: #000000;">20</span>,nFrameWidth,oBmp:<span style="color: #000000;">nHeight</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span> <br /><br /><span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">TIMER</span> oTmr <span style="color: #0000ff;">OF</span> oDlg ; <br /><br /><span style="color: #0000ff;">INTERVAL</span> <span style="color: #000000;">70</span> <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">(</span> <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> oBmp:<span style="color: #000000;">nY</span> < -oBmp:<span style="color: #000000;">nWidth</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> + nFrameWidth*<span style="color: #000000;">2</span>,oBmp:<span style="color: #000000;">nY</span> := <span style="color: #000000;">0</span>,; <br /><br />oBmp:<span style="color: #000000;">nY</span> -= nFrameWidth <span style="color: #000000;">)</span>, oBmp:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span> .f. <span style="color: #000000;">)</span> <span style="color: #000000;">)</span> <br /><br /><span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">TIMER</span> oTmr <br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span></div>[/code:2tbtr1uz]
|
A sample how to create a IMAGE-ani. ( indexbuilder ) UPD.
|
Uwe,
with Paco Banner class I have the same result ....
[img:29q13cb8]http://www.eoeo.it/wp-content/uploads/2015/05/mm.bmp[/img:29q13cb8]
I make a test with your 16 bmps
[b:29q13cb8]the code[/b:29q13cb8]
[code=fw:29q13cb8]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"fivewin.ch"</span><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"banner.ch"</span><br /><br /><span style="color: #00C800;">function</span> main<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">Local</span> oDlg, oBanner<br /><span style="color: #00C800;">Local</span> aPasos := <span style="color: #000000;">{</span> <span style="color: #000000;">{</span> PONER, <span style="color: #000000;">0</span> <span style="color: #000000;">}</span>,;<br /> <span style="color: #000000;">{</span> PONER, <span style="color: #000000;">0</span> <span style="color: #000000;">}</span>,;<br /> <span style="color: #000000;">{</span> PONER, <span style="color: #000000;">0</span> <span style="color: #000000;">}</span>,;<br /> <span style="color: #000000;">{</span> PONER, <span style="color: #000000;">0</span> <span style="color: #000000;">}</span>,;<br /> <span style="color: #000000;">{</span> PONER, <span style="color: #000000;">0</span> <span style="color: #000000;">}</span>,;<br /> <span style="color: #000000;">{</span> PONER, <span style="color: #000000;">0</span> <span style="color: #000000;">}</span>,;<br /> <span style="color: #000000;">{</span> PONER, <span style="color: #000000;">0</span> <span style="color: #000000;">}</span>,;<br /> <span style="color: #000000;">{</span> PONER, <span style="color: #000000;">0</span> <span style="color: #000000;">}</span>,;<br /> <span style="color: #000000;">{</span> PONER, <span style="color: #000000;">0</span> <span style="color: #000000;">}</span>,;<br /> <span style="color: #000000;">{</span> PONER, <span style="color: #000000;">0</span> <span style="color: #000000;">}</span>,;<br /> <span style="color: #000000;">{</span> PONER, <span style="color: #000000;">0</span> <span style="color: #000000;">}</span>,;<br /> <span style="color: #000000;">{</span> PONER, <span style="color: #000000;">0</span> <span style="color: #000000;">}</span>,;<br /> <span style="color: #000000;">{</span> PONER, <span style="color: #000000;">0</span> <span style="color: #000000;">}</span>,;<br /> <span style="color: #000000;">{</span> PONER, <span style="color: #000000;">0</span> <span style="color: #000000;">}</span>,;<br /> <span style="color: #000000;">{</span> PONER, <span style="color: #000000;">0</span> <span style="color: #000000;">}</span>,;<br /> <span style="color: #000000;">{</span> PONER, <span style="color: #000000;">0</span> <span style="color: #000000;">}</span> <span style="color: #000000;">}</span><br /><br /><br /><span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">NAME</span> <span style="color: #ff0000;">"DIALOG_1"</span> <span style="color: #0000ff;">COLOR</span> CLR_BLACK, CLR_WHITE<br /><br /><br /> <span style="color: #0000ff;">REDEFINE</span> BANNER oBanner <span style="color: #0000ff;">ID</span> <span style="color: #000000;">101</span> <span style="color: #0000ff;">OF</span> oDlg ;<br /> <span style="color: #0000ff;">BITMAPS</span> <span style="color: #ff0000;">"BMPS<span style="color: #000000;">\A</span>_1.bmp"</span> ,;<br /> <span style="color: #ff0000;">"BMPS<span style="color: #000000;">\A</span>_2.bmp"</span> ,;<br /> <span style="color: #ff0000;">"BMPS<span style="color: #000000;">\A</span>_3.bmp"</span> ,;<br /> <span style="color: #ff0000;">"BMPS<span style="color: #000000;">\A</span>_4.bmp"</span> ,;<br /> <span style="color: #ff0000;">"BMPS<span style="color: #000000;">\A</span>_5.bmp"</span> ,;<br /> <span style="color: #ff0000;">"BMPS<span style="color: #000000;">\A</span>_6.bmp"</span> ,;<br /> <span style="color: #ff0000;">"BMPS<span style="color: #000000;">\A</span>_7.bmp"</span> ,;<br /> <span style="color: #ff0000;">"BMPS<span style="color: #000000;">\A</span>_8.bmp"</span> ,;<br /> <span style="color: #ff0000;">"BMPS<span style="color: #000000;">\A</span>_9.bmp"</span> ,;<br /> <span style="color: #ff0000;">"BMPS<span style="color: #000000;">\A</span>_10.bmp"</span> ,;<br /> <span style="color: #ff0000;">"BMPS<span style="color: #000000;">\A</span>_11.bmp"</span> ,;<br /> <span style="color: #ff0000;">"BMPS<span style="color: #000000;">\A</span>_12.bmp"</span> ,;<br /> <span style="color: #ff0000;">"BMPS<span style="color: #000000;">\A</span>_13.bmp"</span> ,;<br /> <span style="color: #ff0000;">"BMPS<span style="color: #000000;">\A</span>_14.bmp"</span> ,;<br /> <span style="color: #ff0000;">"BMPS<span style="color: #000000;">\A</span>_15.bmp"</span> ,;<br /> <span style="color: #ff0000;">"BMPS<span style="color: #000000;">\A</span>_16.bmp"</span> ;<br /> SPEED <span style="color: #000000;">0.05</span> ;<br /> EFECTS aPasos ;<br /> FRAMES <span style="color: #000000;">1</span><br /><br /><br /><br /><span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">CENTERED</span><br /><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span></div>[/code:29q13cb8]
|
A sample how to create a IMAGE-ani. ( indexbuilder ) UPD.
|
Silvio,
my solution offers more effects.
During indexing, I can change the animation-style / color ( using any frames ).
Sample :
from 0 - 25 % indexing I can use frameset < B >
from 26 - 50 % I can change to frameset < D > and so on ( starting with blue and ending with red )
The frames are not fixed defined at startup.
You can test it by yourself selecting another style during indexing.
I will show / create a extended sample
[img:20wafohv]http://www.service-fivewin.de/images/Animat7.jpg[/img:20wafohv]
regards
Uwe <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D -->
|
A sample how to create a IMAGE-ani. ( indexbuilder ) UPD.
|
on banner class you have many animations styles
SPEED
FRAMES
EFFECTS ( Miror,Poner, Mengua,Crece,Cortina,Turn) to UP, Down,Left ,Right , top, Vertical, Horizzontal
ACTIONS
Perhaps it is possible add new effects ...
the problems of the class is no pubblic and I cannot send you it
|
A sample how to create a IMAGE-ani. ( indexbuilder ) UPD.
|
Colorchange ( type 2 ) during indexing from red to blue :
before creating something new like classes .....
I try using existing functions / or parts of other solutions / samples to solve a problem
scooping all possibilities the basic-FWH offers
DOWNLOAD :
<!-- m --><a class="postlink" href="http://www.service-fivewin.de/DOWNLOADS/Animat4.zip">http://www.service-fivewin.de/DOWNLOADS/Animat4.zip</a><!-- m -->
[img:28re71is]http://www.service-fivewin.de/images/Animat8.jpg[/img:28re71is]
[img:28re71is]http://www.service-fivewin.de/images/Animat7.jpg[/img:28re71is]
Silvio,
from Your sample :
The images are fixed defined,
how do You can change to other images ( split image-group on defined percent )
REDEFINE BANNER oBanner ID 101 OF oDlg ;
BITMAPS "BMPS\A_1.bmp" ,;
"BMPS\A_2.bmp" ,;
"BMPS\A_3.bmp" ,;
"BMPS\A_4.bmp" ,;
"BMPS\A_5.bmp" ,;
"BMPS\A_6.bmp" ,;
"BMPS\A_7.bmp" ,;
"BMPS\A_8.bmp" ,;
"BMPS\A_9.bmp" ,;
"BMPS\A_10.bmp" ,;
"BMPS\A_11.bmp" ,;
"BMPS\A_12.bmp" ,;
"BMPS\A_13.bmp" ,;
"BMPS\A_14.bmp" ,;
"BMPS\A_15.bmp" ,;
"BMPS\A_16.bmp" ;
SPEED 0.05 ;
EFECTS aPasos ;
FRAMES 1
regards
Uwe <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D -->
|
A sample how to create a IMAGE-ani. ( indexbuilder ) UPD.
|
Great work Uwe, many compliments.
|
A sample how to create a IMAGE-ani. ( indexbuilder ) UPD.
|
It was just to tell you that there were already classes that make animation FWH.
My advice FWH needs new classes or interesting objects and not always heat the hot water ....
But if she dear sir fun in this way, you can continue on this path ... I will enjoy it to find new ideas ....for fwh
<!-- s:) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":)" title="Smile" /><!-- s:) -->
|
A sample how to create a IMAGE-ani. ( indexbuilder ) UPD.
|
[quote="ukoenig":34x068do]
before creating something new like classes .....
I try using existing functions / or parts of other solutions / samples to solve a problem
scooping all possibilities the basic-FWH offers
[/quote:34x068do]
<!-- s:wink: --><img src="{SMILIES_PATH}/icon_wink.gif" alt=":wink:" title="Wink" /><!-- s:wink: --> <!-- s:wink: --><img src="{SMILIES_PATH}/icon_wink.gif" alt=":wink:" title="Wink" /><!-- s:wink: --> <!-- s:wink: --><img src="{SMILIES_PATH}/icon_wink.gif" alt=":wink:" title="Wink" /><!-- s:wink: -->
|
A sample how to create a IMAGE-ani. ( indexbuilder ) UPD.
|
I not talk with cartoons!!!
I not seen any new classes created by this cartoons!!!
<!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D --> <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D --> <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D --> <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D -->
|
A sample how to create a IMAGE-ani. ( indexbuilder ) UPD.
|
Updated
What's new :
[color=#0000FF:3a58zwik]1.) 9 DBF's are included with sizes from 50 - 100000 records
2.) new animation-speed-calculation added
----the speed is always the same no matter of DBF-size
----calculated in relation to DELAY and defined STEPS ( no fixed speed-value )
3.) selections can be saved to a INI
4.) a record-counter is added to the meter
5.) added a little help-file[/color:3a58zwik]
On my computer with DELAY 20 and STEPS 40 I got a nice result
using [color=#0000FF:3a58zwik][b:3a58zwik]GetCPUSpeed() [/b:3a58zwik][/color:3a58zwik], You can use a factor to reduce or increase the values
The test ist included just enable the messages
on my computer
[color=#0000FF:3a58zwik]Speed : 2799
Records : 100000
Delay : 20
Steps : 50
Starttime : 22:03:38
Endtime : 22:03:40
adjusted to a speed-result of 2 seconds !!![/color:3a58zwik]
to calculate a factor I need some comparisons to get a equal speed on different computers
DOWNLOAD :
( size 11 MB because of 9 included DBF's )
<!-- m --><a class="postlink" href="http://www.service-fivewin.de/DOWNLOADS/Animat5.zip">http://www.service-fivewin.de/DOWNLOADS/Animat5.zip</a><!-- m -->
[img:3a58zwik]http://www.service-fivewin.de/IMAGES/Animat9.jpg[/img:3a58zwik]
regards
Uwe <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D -->
|
A sample how to create a IMAGE-ani. ( indexbuilder ) UPD.
|
added a transparent counter shown centered inside of a animation.
can be records or percent
[img:2zxp7s4h]http://www.service-fivewin.de/IMAGES/Animat10.jpg[/img:2zxp7s4h]
add in function :
FUNCTION SET_ANI( oImage, nRecPos[color=#0000FF:2zxp7s4h], oTextFont2 [/color:2zxp7s4h])
...
...
[color=#0000FF:2zxp7s4h]oImage:bPainted := {|| oImage:Say( oImage:nHeight / 2.0 - oTextFont2:nHeight / 2, ;
( oImage:nWidth/2 ) -40, STR( nCounter ), , ,oTextFont2 , .t., .t., 0 ) } [/color:2zxp7s4h]
RETURN NIL
and in function :
FUNCTION MAKE_INDEX( oMeter1, nRecPos, oImage, oTextFont2 )
...
...
SET_ANI( oImage, @nRecPos, [color=#0000FF:2zxp7s4h]oTextFont2[/color:2zxp7s4h] ), ; // animation
...
...
oMeter1:bPainted := {|| oMeter1:Say( oMeter1:nHeight / 4.0, ;
( oMeter1:nWidth/2 ) -40, STR( nRecords ), , ,oTextFont2 , .t., .t., 0 ) }
[color=#0000FF:2zxp7s4h]oImage:bPainted := {|| oImage:Say( oImage:nHeight / 2.0 - oTextFont2:nHeight / 2, ;
( oImage:nWidth/2 ) -40, STR( nRecords ), , ,oTextFont2 , .t., .t., 0 ) } [/color:2zxp7s4h]
regards
Uwe <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D -->
|
A sample how to create a IMAGE-ani. ( indexbuilder ) UPD.
|
Uwe <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D -->
New link for download, please.
Many thanks.
Regards, saludos.
|
A sample how to create a IMAGE-ani. ( indexbuilder ) UPD.
|
[quote:tuad7vuq]New link for download, please.[/quote:tuad7vuq]
All links are updated <!-- s:!: --><img src="{SMILIES_PATH}/icon_exclaim.gif" alt=":!:" title="Exclamation" /><!-- s:!: -->
regards
Uwe <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D -->
|
A sample how to create a IMAGE-ani. ( indexbuilder ) UPD.
|
Great.
Super many thanks.
Regards, saludos.
|
A sample report – screenshots
|
I have finished a report with FASTREPORT.
I show charts for every month and within the chart I compare 2 years (black and green). Under every chart I print the single values.
First I show with xBrowse the whole report and the user can select with tabs the exactly report he wants.
Best regards,
Otto
[img:3ebpnlwi]http://atzwanger-software.com/fr/xbrw.jpg[/img:3ebpnlwi]
[img:3ebpnlwi]http://atzwanger-software.com/fr/fast.jpg[/img:3ebpnlwi]
|
A sample report – screenshots
|
In the GroupHeader I insert the Charts 1 – 12 for each month.
Then on the OnBeforePrint –event of the Groupheader I set the Chart of the corresponding month visible.
Best regards,
Otto
[img:2wxlzyoc]http://www.atzwanger-software.com/fr/chart1.jpg[/img:2wxlzyoc]
[code=fw:2wxlzyoc]<div class="fw" id="{CB}" style="font-family: monospace;"><br />GroupHeader11OnBeforePrint<br /><br />procedure GroupHeader11OnBeforePrint<span style="color: #000000;">(</span>Sender: <span style="color: #000000;">TfrxComponent</span><span style="color: #000000;">)</span>;<br />begin<br /><br />Chart1.Visible := <span style="color: #00C800;">FALSE</span> ;<br />Chart2.Visible := <span style="color: #00C800;">FALSE</span> ;<br />Chart3.Visible := <span style="color: #00C800;">FALSE</span> ;<br />Chart4.Visible := <span style="color: #00C800;">FALSE</span> ;<br />Chart5.Visible := <span style="color: #00C800;">FALSE</span> ;<br />Chart6.Visible := <span style="color: #00C800;">FALSE</span> ;<br />Chart7.Visible := <span style="color: #00C800;">FALSE</span> ;<br />Chart8.Visible := <span style="color: #00C800;">FALSE</span> ;<br />Chart9.Visible := <span style="color: #00C800;">FALSE</span> ;<br />Chart10.Visible := <span style="color: #00C800;">FALSE</span> ;<br />Chart11.Visible := <span style="color: #00C800;">FALSE</span> ;<br />Chart12.Visible := <span style="color: #00C800;">FALSE</span> ;<br /><br />Chart1.Visible := <Jahr.<span style="color: #ff0000;">"MONAT"</span>> = <span style="color: #000000;">1</span> ;<br />Chart2.Visible := <Jahr.<span style="color: #ff0000;">"MONAT"</span>> = <span style="color: #000000;">2</span> ;<br />Chart3.Visible := <Jahr.<span style="color: #ff0000;">"MONAT"</span>> = <span style="color: #000000;">3</span> ;<br />Chart4.Visible := <Jahr.<span style="color: #ff0000;">"MONAT"</span>> = <span style="color: #000000;">4</span> ;<br />Chart5.Visible := <Jahr.<span style="color: #ff0000;">"MONAT"</span>> = <span style="color: #000000;">5</span> ;<br />Chart6.Visible := <Jahr.<span style="color: #ff0000;">"MONAT"</span>> = <span style="color: #000000;">6</span> ;<br />Chart7.Visible := <Jahr.<span style="color: #ff0000;">"MONAT"</span>> = <span style="color: #000000;">7</span> ;<br />Chart8.Visible := <Jahr.<span style="color: #ff0000;">"MONAT"</span>> = <span style="color: #000000;">8</span> ;<br />Chart9.Visible := <Jahr.<span style="color: #ff0000;">"MONAT"</span>> = <span style="color: #000000;">9</span> ;<br />Chart10.Visible := <Jahr.<span style="color: #ff0000;">"MONAT"</span>> = <span style="color: #000000;">10</span> ;<br />Chart11.Visible := <Jahr.<span style="color: #ff0000;">"MONAT"</span>> = <span style="color: #000000;">11</span> ;<br />Chart12.Visible := <Jahr.<span style="color: #ff0000;">"MONAT"</span>> = <span style="color: #000000;">12</span> ;<br /> <br />end;</div>[/code:2wxlzyoc]
|
A sample to print with REPrintBox5 a memo on two pages ?
|
Hello,
I'm looking for a simple way to print with [color=#0000FF:2x5r3xxk][b:2x5r3xxk]richedi5[/b:2x5r3xxk][/color:2x5r3xxk] a memofield on two pages
I Added a print-button to the sample-collector for printing samples.
Just a textsplitting is needed ( max 2 pages nothing special )
I couln't find any sample.
One page printing of imported topics
[code=fw:2x5r3xxk]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00C800;">STATIC</span> <span style="color: #00C800;">FUNCTION</span> PRINTTOPIC<span style="color: #000000;">(</span> lPreview, oTCode, cTopic, cTAuthor, cTLink <span style="color: #000000;">)</span><br /><span style="color: #00C800;">LOCAL</span> oPrn<br /><br /><span style="color: #00C800;">LOCAL</span> aRTF := <span style="color: #000000;">{</span> <span style="color: #000000;">0</span>, <span style="color: #000000;">100</span> <span style="color: #000000;">}</span> <span style="color: #B900B9;">// { nFrom, nTop }</span><br /><br /><span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">FONT</span> oBold <span style="color: #0000ff;">NAME</span> <span style="color: #ff0000;">"Arial"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">0</span>,<span style="color: #000000;">-56</span> BOLD<br /><span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">FONT</span> oMono <span style="color: #0000ff;">NAME</span> <span style="color: #ff0000;">"Arial"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">0</span>,<span style="color: #000000;">-12</span><br /><br /><span style="color: #00C800;">DEFAULT</span> lPreview := .f.<br /><br /><span style="color: #00C800;">IF</span> lPreview<br /> <span style="color: #00C800;">PRINT</span> oPrn <span style="color: #0000ff;">NAME</span> <span style="color: #ff0000;">"FWH SAMPLE FILE"</span> PREVIEW<br /><span style="color: #00C800;">ELSE</span><br /> <span style="color: #00C800;">PRINT</span> oPrn <span style="color: #0000ff;">NAME</span> <span style="color: #ff0000;">"FWH SAMPLE FILE"</span><br /><span style="color: #00C800;">ENDIF</span><br /><br /><span style="color: #00C800;">IF</span> EMPTY<span style="color: #000000;">(</span> oPrn:<span style="color: #000000;">hDC</span> <span style="color: #000000;">)</span><br /> MsgStop<span style="color: #000000;">(</span> <span style="color: #ff0000;">"Printer not ready!"</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br /><span style="color: #00C800;">ENDIF</span><br /><br /><span style="color: #0000ff;">PAGE</span><br /> CURSORWAIT<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> oPrn:<span style="color: #000000;">InchSay</span><span style="color: #000000;">(</span> <span style="color: #000000;">0.40</span>, <span style="color: #000000;">0.95</span>, cTopic, oBold <span style="color: #000000;">)</span><br /> oPrn:<span style="color: #000000;">InchSay</span><span style="color: #000000;">(</span> <span style="color: #000000;">0.50</span>, <span style="color: #000000;">0.95</span>, cTAuthor, oBold <span style="color: #000000;">)</span><br /> oPrn:<span style="color: #000000;">InchSay</span><span style="color: #000000;">(</span> <span style="color: #000000;">0.60</span>, <span style="color: #000000;">0.95</span>, cTLink, oBold <span style="color: #000000;">)</span><br /><br /> <span style="color: #B900B9;">// nFrom := REPrintBox5( ::hWnd, hDC, ::IsSelection(), ;</span><br /> <span style="color: #B900B9;">// nTop, nLeft, nRight, nBottom, nFrom )</span><br /> aRTF := REPrintBox5<span style="color: #000000;">(</span> oTCode:<span style="color: #000000;">hWnd</span>, <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> lPreview, oPrn:<span style="color: #000000;">hDCOut</span>, oPrn:<span style="color: #000000;">hDC</span> <span style="color: #000000;">)</span>, ;<br /> oTCode:<span style="color: #000000;">IsSelection</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>, ;<br /> aRTF<span style="color: #000000;">[</span> <span style="color: #000000;">2</span> <span style="color: #000000;">]</span> + <span style="color: #000000;">500</span>, <span style="color: #000000;">500</span>, <span style="color: #000000;">3500</span>, aRTF<span style="color: #000000;">[</span> <span style="color: #000000;">2</span> <span style="color: #000000;">]</span> + <span style="color: #000000;">5500</span>, aRTF<span style="color: #000000;">[</span> <span style="color: #000000;">1</span> <span style="color: #000000;">]</span> <span style="color: #000000;">)</span><br /> <br /> CursorArrow<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><span style="color: #0000ff;">ENDPAGE</span><br /><br /><span style="color: #0000ff;">ENDPRINT</span><br /><br />oBold:<span style="color: #000000;">End</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br />oMono:<span style="color: #000000;">End</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br /> </div>[/code:2x5r3xxk]
[img:2x5r3xxk]http://www.pflegeplus.com/IMAGES/Forum49.jpg[/img:2x5r3xxk]
regards
Uwe <!-- s:?: --><img src="{SMILIES_PATH}/icon_question.gif" alt=":?:" title="Question" /><!-- s:?: -->
|
A sample to print with REPrintBox5 a memo on two pages ?
|
Uwe
I do not know if I have understood your question correctly, but you can insert a page break in your text when you need it
[code=fw:1ghwc9vy]<div class="fw" id="{CB}" style="font-family: monospace;"><br />oRTF: <span style="color: #000000;">PageBreak</span> <span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> </div>[/code:1ghwc9vy]
Also you have methods and data for you editor
[code=fw:1ghwc9vy]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><br /> <span style="color: #00C800;">DATA</span> lShowPageBreak<br /><br /> <span style="color: #00C800;">METHOD</span> HidePageBreak<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">METHOD</span> ShowPageBreak<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">METHOD</span> PageSetup<span style="color: #000000;">(</span> nTop, nLeft, nRight, nBottom <span style="color: #000000;">)</span><br /><br /> </div>[/code:1ghwc9vy]
|
A sample to print with REPrintBox5 a memo on two pages ?
|
Christobal,
I scanned the complete forum and found 42 topics about richedit
but NO infos about a textbreak during printing to a new page
Do You mean to count the lines and include a pagebreak on a defined position [color=#0000FF:20swjej6]BEFORE[/color:20swjej6] printing ?
[img:20swjej6]http://www.pflegeplus.com/IMAGES/Forum50.jpg[/img:20swjej6]
regards
Uwe <!-- s:?: --><img src="{SMILIES_PATH}/icon_question.gif" alt=":?:" title="Question" /><!-- s:?: -->
|
A sample to print with REPrintBox5 a memo on two pages ?
|
This is a old method of richedit ( and also for richedit5 )
<!-- l --><a class="postlink-local" href="http://forums.fivetechsupport.com/viewtopic.php?f=16&t=6594&p=29464&hilit=PageBreak#p29464">viewtopic.php?f=16&t=6594&p=29464&hilit=PageBreak#p29464</a><!-- l -->
That's why I have not mentioned it
|
A sample to print with REPrintBox5 a memo on two pages ?
|
[quote="ukoenig":26gua4k2]Christobal,
Do You mean to count the lines and include a pagebreak on a defined position [color=#0000FF:26gua4k2]BEFORE[/color:26gua4k2] printing ?
regards
Uwe <!-- s:?: --><img src="{SMILIES_PATH}/icon_question.gif" alt=":?:" title="Question" /><!-- s:?: -->[/quote:26gua4k2]
Uwe
Explain the reason for your question in the firts topic
I think I have not understood your needs well
|
A sample to print with REPrintBox5 a memo on two pages ?
|
Cristobal,
I counted [color=#0000FF:jnd962v7][b:jnd962v7]60 lines [/b:jnd962v7][/color:jnd962v7] of possible code printing the first page.
That means for topics > 60 lines in size I need a second page for printing.
It is just a textsplitting I need.
I noticed a maximum of possible 2 pages a topic might need for printing.
No problem on other printings I've done before but richedit is different.
regards
Uwe <!-- s:?: --><img src="{SMILIES_PATH}/icon_question.gif" alt=":?:" title="Question" /><!-- s:?: -->
|
A sample to print with REPrintBox5 a memo on two pages ?
|
[quote="ukoenig":63uo1tsv]Cristobal,
I counted [color=#0000FF:63uo1tsv][b:63uo1tsv]60 lines [/b:63uo1tsv][/color:63uo1tsv] of possible code printing the first page.
That means for topics > 60 lines in size I need a second page for printing.
It is just a textsplitting I need.
I noticed a maximum of possible 2 pages a topic might need for printing.
No problem on other printings I've done before but richedit is different.
regards
Uwe <!-- s:?: --><img src="{SMILIES_PATH}/icon_question.gif" alt=":?:" title="Question" /><!-- s:?: -->[/quote:63uo1tsv]
Now I think I understand what you mean
Are you looking for an automatic way to format the printout in the required pages of the RichEdit5 control text?
|
A sample to print with REPrintBox5 a memo on two pages ?
|
Cristobal,
Yes that is what I mean. 90 % of the topic-code is small in size and only 1 page is needed
but I would like to cover bigger text as well.
[quote:238h0n2e]Now I think I understand what you mean
Are you looking for an automatic way to format the printout in the required pages of the RichEdit5 control text?[/quote:238h0n2e]
regards
Uwe <!-- s:? --><img src="{SMILIES_PATH}/icon_confused.gif" alt=":?" title="Confused" /><!-- s:? -->
|
A sample to print with REPrintBox5 a memo on two pages ?
|
Ok
You have
[code=fw:238qhpbk]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><br />oRTF:<span style="color: #000000;">LastLineVisible</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><span style="color: #B900B9;">//and</span><br /> oRTF:<span style="color: #000000;">GetLineCount</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /><span style="color: #B900B9;">//after</span><br /> oRTF:<span style="color: #000000;">GotoLine</span><span style="color: #000000;">(</span> nLine <span style="color: #000000;">)</span> <span style="color: #B900B9;">// calculate line from LastLineVisible and GetLineCount and insert PageBreak</span><br /><br /> </div>[/code:238qhpbk]
Please, If I can help you with anything, tell me
|
A sample to print with REPrintBox5 a memo on two pages ?
|
Cristobal,
printing on multiple pages works but I didn't use pagebreak.
Next I want to show colored keywords.
I think it is not tested showing / refresh a new text on xbrowse row-change.
Adding [color=#0000FF:wqxnwa3s]HIGHLIGHT[/color:wqxnwa3s] is giving a terrible effect :
the complete dialog is < fllckering / refreshed > on row-change and the display slows down.
I think using it on a standalonetext it doesn't matter but not for a fast text-changing with xBrowse.
@ 40, 625 RICHEDIT5 oTCode VAR cTCode OF oDlg SIZE 600, 410 ; // w h
FONT oFont PIXEL HSCROLL [color=#0000FF:wqxnwa3s]HIGHLIGHT[/color:wqxnwa3s] <!-- s:cry: --><img src="{SMILIES_PATH}/icon_cry.gif" alt=":cry:" title="Crying or Very sad" /><!-- s:cry: -->
with my next release I can include the normal and a version with activated highlight
maybe there is another solution possible
[b:wqxnwa3s]NO[/b:wqxnwa3s] bad effects using :
[color=#0000FF:wqxnwa3s][b:wqxnwa3s]Colorize( nStart, nEnd, nColor )[/b:wqxnwa3s][/color:wqxnwa3s]
regards
Uwe <!-- s:?: --><img src="{SMILIES_PATH}/icon_question.gif" alt=":?:" title="Question" /><!-- s:?: -->
|
A sample to print with REPrintBox5 a memo on two pages ?
|
Did you look at this ? Seems to work for Xbrowse
Compile in samples
[code=fw:1vxs0qld]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"FiveWin.ch"</span><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"RichEdit.ch"</span><br /><br /><span style="color: #00C800;">function</span> Main<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">local</span> cTitle:=<span style="color: #ff0000;">"Test"</span><br /> <span style="color: #00C800;">local</span> cResult, oMemo<br /> <span style="color: #00C800;">Public</span> cShowstr:=<span style="color: #ff0000;">""</span><br /> <span style="color: #00C800;">Public</span> oDlg<br /><br /> REQUEST DBFCDX<br /><br /> USE clients via <span style="color: #ff0000;">"DBFCDX"</span> <span style="color: #00C800;">NEW</span><br /><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">FONT</span> oFont <span style="color: #0000ff;">NAME</span> <span style="color: #ff0000;">"Courier New"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">8</span>,<span style="color: #000000;">15</span><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">FONT</span> oBold <span style="color: #0000ff;">NAME</span> <span style="color: #ff0000;">"Courier New"</span> BOLD <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">8</span>,<span style="color: #000000;">15</span><br /><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">FROM</span> <span style="color: #000000;">5</span>,<span style="color: #000000;">10</span> <span style="color: #0000ff;">TO</span> <span style="color: #000000;">50</span>, <span style="color: #000000;">200</span> <span style="color: #0000ff;">font</span> oFont <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"Test Color"</span><br /><br /> @ <span style="color: #000000;">10</span>, <span style="color: #000000;">10</span> <span style="color: #0000ff;">XBROWSE</span> oBrw <span style="color: #0000ff;">OF</span> oDlg ;<br /> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">400</span>, <span style="color: #000000;">200</span> <span style="color: #0000ff;">PIXEL</span> ;<br /> COLUMNS <span style="color: #ff0000;">'Name'</span>, <span style="color: #ff0000;">'Adress'</span>, <span style="color: #ff0000;">'Notes'</span> ;<br /> <span style="color: #0000ff;">ALIAS</span> <span style="color: #ff0000;">'CLIENTS'</span> NOBORDER<br /><br /> WITH OBJECT oBrw<br /><br /> :<span style="color: #000000;">nColDividerStyle</span> := LINESTYLE_LIGHTGRAY<br /> :<span style="color: #000000;">nRowDividerStyle</span> := LINESTYLE_LIGHTGRAY<br /> :<span style="color: #000000;">bClrRowFocus</span> := <span style="color: #000000;">{</span> || <span style="color: #000000;">{</span> CLR_BLACK, RGB<span style="color: #000000;">(</span><span style="color: #000000;">185</span>,<span style="color: #000000;">220</span>,<span style="color: #000000;">255</span><span style="color: #000000;">)</span> <span style="color: #000000;">}</span> <span style="color: #000000;">}</span><br /> :<span style="color: #000000;">nMarqueeStyle</span> := MARQSTYLE_HIGHLROWMS<br /><br /> :<span style="color: #000000;">bChange</span> := <span style="color: #000000;">{</span> || oSay:<span style="color: #0000ff;">refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>,showmemo<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /><br /> :<span style="color: #000000;">CreateFromCode</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> END<br /><br /> @ <span style="color: #000000;">10</span>,<span style="color: #000000;">460</span> <span style="color: #0000ff;">SAY</span> oSay <span style="color: #0000ff;">PROMPT</span> clients->notes <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">200</span>,<span style="color: #000000;">200</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">COLOR</span> CLR_BLACK <span style="color: #0000ff;">update</span> <span style="color: #B900B9;">//TRANSPARENT</span><br /><br /> <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">CENTERED</span><br /><br /> close all<br /><span style="color: #00C800;">Return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #00C800;">function</span> showmemo<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">Local</span> cStr:=<span style="color: #ff0000;">""</span><br /> <span style="color: #00C800;">local</span> cChange:= <span style="color: #ff0000;">"FiveWin"</span> <span style="color: #B900B9;">// Word that we will look for</span><br /> <span style="color: #00C800;">local</span> cInto:= <span style="color: #ff0000;">"<span style="color: #000000;">\c</span>f2 FiveWin <span style="color: #000000;">\c</span>f1"</span> <span style="color: #B900B9;">// Put Word in Color</span><br /><br /><br /> cText = alltrim<span style="color: #000000;">(</span>clients->notes<span style="color: #000000;">)</span><br /><br /> cStr += <span style="color: #ff0000;">"{<span style="color: #000000;">\r</span>tf1<span style="color: #000000;">\a</span>nsi<span style="color: #000000;">\d</span>eff0"</span><br /> cStr += <span style="color: #ff0000;">"{<span style="color: #000000;">\c</span>olortbl;<span style="color: #000000;">\r</span>ed0<span style="color: #000000;">\g</span>reen0<span style="color: #000000;">\b</span>lue0;<span style="color: #000000;">\r</span>ed255<span style="color: #000000;">\g</span>reen0<span style="color: #000000;">\b</span>lue0;}"</span><br /> cstr = cStr + cText<br /> cStr += <span style="color: #ff0000;">"}"</span><br /><br /> cShowStr = StrTran<span style="color: #000000;">(</span> cStr, cChange, cInto <span style="color: #000000;">)</span> <span style="color: #B900B9;">// --> "Harbour Power"</span><br /><br /> hDLL = LoadLibrary<span style="color: #000000;">(</span> <span style="color: #ff0000;">'riched20.dll'</span> <span style="color: #000000;">)</span><br /> @ <span style="color: #000000;">250</span>,<span style="color: #000000;">900</span> RICHEDIT oMemo <span style="color: #0000ff;">VAR</span> cShowstr <span style="color: #0000ff;">of</span> oDlg <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">300</span>,<span style="color: #000000;">400</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">NIL</span><br /> </div>[/code:1vxs0qld]
|
A sample to print with REPrintBox5 a memo on two pages ?
|
Marc,
thank You I will ckeck it
It is number[color=#0000FF:qx9zpzzc] [b:qx9zpzzc]4[/b:qx9zpzzc][/color:qx9zpzzc] position of the browser.
All what we need is coloring the filtertext inside the memo
The result importing from the FWH-sample direcory
[color=#0000FF:qx9zpzzc]1085[/color:qx9zpzzc] files and [color=#0000FF:qx9zpzzc]12[/color:qx9zpzzc] files filtering the keyword [color=#0000FF:qx9zpzzc]richedit[/color:qx9zpzzc]
done in just 5 minutes time <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D -->
I tested the function but doesn't work
[color=#0000FF:qx9zpzzc]in xbrowse included
:bChange := { || SHOWMEMO(oTCode, ALLTRIM(cTCode), ALLTRIM(cTFilter)), ;
...
...
@ 40, 625 RICHEDIT5 oTCode VAR cTCode OF oDlg SIZE 600, 410 ; // w h
FONT oFont PIXEL HSCROLL // HIGHLIGHT ( bad )
// -----------------
FUNCTION SHOWMEMO(oTCode, cTCode, cTFilter)
LOCAL cStr :="", cChange := cTFilter // Word that we will look for
LOCAL cInto := "\cf2 " + cTFilter + " \cf1" // Put Word in Color
cStr += "{\rtf1\ansi\deff0"
cStr += "{\colortbl;\red0\green0\blue0;\red255\green0\blue0;}"
cstr = cStr + cTCode
cStr += "}"
cShowStr = StrTran( cStr, cChange, cInto )
oTCode:SetText( cShowStr )
RETURN NIL[/color:qx9zpzzc]
[img:qx9zpzzc]http://www.pflegeplus.com/IMAGES/Forum55.jpg[/img:qx9zpzzc]
regards
Uwe <!-- s:?: --><img src="{SMILIES_PATH}/icon_question.gif" alt=":?:" title="Question" /><!-- s:?: -->
|
A sample to print with REPrintBox5 a memo on two pages ?
|
[quote="ukoenig":1bhydo4d]Cristobal,
printing on multiple pages works but I didn't use pagebreak.
Next I want to show colored keywords.
I think it is not tested showing / refresh a new text on xbrowse row-change.
Adding [color=#0000FF:1bhydo4d]HIGHLIGHT[/color:1bhydo4d] is giving a terrible effect :
the complete dialog is < fllckering / refreshed > on row-change and the display slows down.
I think using it on a standalonetext it doesn't matter but not for a fast text-changing with xBrowse.
@ 40, 625 RICHEDIT5 oTCode VAR cTCode OF oDlg SIZE 600, 410 ; // w h
FONT oFont PIXEL HSCROLL [color=#0000FF:1bhydo4d]HIGHLIGHT[/color:1bhydo4d] <!-- s:cry: --><img src="{SMILIES_PATH}/icon_cry.gif" alt=":cry:" title="Crying or Very sad" /><!-- s:cry: -->
with my next release I can include the normal and a version with activated highlight
maybe there is another solution possible
[b:1bhydo4d]NO[/b:1bhydo4d] bad effects using :
[color=#0000FF:1bhydo4d][b:1bhydo4d]Colorize( nStart, nEnd, nColor )[/b:1bhydo4d][/color:1bhydo4d]
regards
Uwe <!-- s:?: --><img src="{SMILIES_PATH}/icon_question.gif" alt=":?:" title="Question" /><!-- s:?: -->[/quote:1bhydo4d]
Please try with this code
[code=fw:1bhydo4d]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"FiveWin.ch"</span><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"RichEdi5.ch"</span><br /><br /><span style="color: #00C800;">Static</span> oDlg<br /><span style="color: #00C800;">Static</span> oBrw<br /><span style="color: #00C800;">Static</span> oMemo<br /><br /><span style="color: #00C800;">function</span> Main<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">local</span> cTitle:=<span style="color: #ff0000;">"Test"</span><br /> <span style="color: #00C800;">local</span> cResult<br /> <span style="color: #00C800;">local</span> oFont, oBold<br /> <span style="color: #00C800;">local</span> oSay<br /><br /> REQUEST DBFCDX<br /><br /> USE clients via <span style="color: #ff0000;">"DBFCDX"</span> <span style="color: #00C800;">NEW</span><br /><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">FONT</span> oFont <span style="color: #0000ff;">NAME</span> <span style="color: #ff0000;">"Courier New"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">8</span>,<span style="color: #000000;">15</span><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">FONT</span> oBold <span style="color: #0000ff;">NAME</span> <span style="color: #ff0000;">"Courier New"</span> BOLD <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">8</span>,<span style="color: #000000;">15</span><br /><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">FROM</span> <span style="color: #000000;">5</span>,<span style="color: #000000;">10</span> <span style="color: #0000ff;">TO</span> <span style="color: #000000;">50</span>, <span style="color: #000000;">170</span> <span style="color: #0000ff;">font</span> oFont <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"Test Color"</span><br /><br /> @ <span style="color: #000000;">10</span>, <span style="color: #000000;">10</span> <span style="color: #0000ff;">XBROWSE</span> oBrw <span style="color: #0000ff;">OF</span> oDlg ;<br /> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">350</span>, <span style="color: #000000;">200</span> <span style="color: #0000ff;">PIXEL</span> ;<br /> COLUMNS <span style="color: #ff0000;">'Name'</span>, <span style="color: #ff0000;">'Adress'</span>, <span style="color: #ff0000;">'Notes'</span> ;<br /> <span style="color: #0000ff;">ALIAS</span> <span style="color: #ff0000;">'CLIENTS'</span> NOBORDER<br /><br /> WITH OBJECT oBrw<br /><br /> :<span style="color: #000000;">nColDividerStyle</span> := LINESTYLE_LIGHTGRAY<br /> :<span style="color: #000000;">nRowDividerStyle</span> := LINESTYLE_LIGHTGRAY<br /> :<span style="color: #000000;">bClrRowFocus</span> := <span style="color: #000000;">{</span> || <span style="color: #000000;">{</span> CLR_BLACK, RGB<span style="color: #000000;">(</span><span style="color: #000000;">185</span>,<span style="color: #000000;">220</span>,<span style="color: #000000;">255</span><span style="color: #000000;">)</span> <span style="color: #000000;">}</span> <span style="color: #000000;">}</span><br /> :<span style="color: #000000;">nMarqueeStyle</span> := MARQSTYLE_HIGHLROWMS<br /><br /> :<span style="color: #000000;">bChange</span> := <span style="color: #000000;">{</span> || oSay:<span style="color: #0000ff;">refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>,showmemo<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /><br /> :<span style="color: #000000;">CreateFromCode</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> END<br /><br /> @ <span style="color: #000000;">10</span>,<span style="color: #000000;">370</span> <span style="color: #0000ff;">SAY</span> oSay <span style="color: #0000ff;">PROMPT</span> clients->notes <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">200</span>, <span style="color: #000000;">80</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">COLOR</span> CLR_BLACK <span style="color: #0000ff;">update</span> <span style="color: #B900B9;">//TRANSPARENT</span><br /><br /> <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">CENTERED</span> <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">INIT</span> showmemo<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> close all<br /><br /><span style="color: #00C800;">Return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #00C800;">function</span> showmemo<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">Local</span> cStr := <span style="color: #ff0000;">""</span><br /> <span style="color: #00C800;">local</span> cChange := <span style="color: #ff0000;">"FiveWin"</span> <span style="color: #B900B9;">// Word that we will look for</span><br /> <span style="color: #00C800;">local</span> cInto := <span style="color: #ff0000;">"<span style="color: #000000;">\h</span>ighlight1 FiveWin <span style="color: #000000;">\h</span>ighlight0"</span> <span style="color: #B900B9;">// Put Word in Color</span><br /> <span style="color: #00C800;">local</span> cText<br /> <span style="color: #00C800;">local</span> cVar := <span style="color: #ff0000;">""</span><br /><br /> cText := clients->notes<br /><br /> cStr += <span style="color: #ff0000;">"{<span style="color: #000000;">\r</span>tf1<span style="color: #000000;">\a</span>nsi<span style="color: #000000;">\a</span>nsicpg1252<span style="color: #000000;">\d</span>eff0<span style="color: #000000;">\n</span>ouicompat<span style="color: #000000;">\d</span>eflang3082{<span style="color: #000000;">\f</span>onttbl{<span style="color: #000000;">\f</span>0<span style="color: #000000;">\f</span>nil<span style="color: #000000;">\f</span>charset0 Tahoma;}}"</span><br /> cStr += <span style="color: #ff0000;">"{<span style="color: #000000;">\c</span>olortbl ;<span style="color: #000000;">\r</span>ed255<span style="color: #000000;">\g</span>reen0<span style="color: #000000;">\b</span>lue0;<span style="color: #000000;">\r</span>ed0<span style="color: #000000;">\g</span>reen0<span style="color: #000000;">\b</span>lue0;<span style="color: #000000;">\r</span>ed128<span style="color: #000000;">\g</span>reen64<span style="color: #000000;">\b</span>lue64;<span style="color: #000000;">\r</span>ed0<span style="color: #000000;">\g</span>reen0<span style="color: #000000;">\b</span>lue128;}"</span><br /> cStr += <span style="color: #ff0000;">"<span style="color: #000000;">\v</span>iewkind4<span style="color: #000000;">\u</span>c1"</span><br /> cStr += <span style="color: #ff0000;">"<span style="color: #000000;">\p</span>ard<span style="color: #000000;">\f</span>s20"</span> + <span style="color: #00C800;">if</span><span style="color: #000000;">(</span> Empty<span style="color: #000000;">(</span> cText <span style="color: #000000;">)</span>, <span style="color: #ff0000;">" "</span>, cText <span style="color: #000000;">)</span><br /> cStr += <span style="color: #ff0000;">"}"</span><br /> cStr := StrTran<span style="color: #000000;">(</span> cStr, cChange, cInto <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">if</span> hb_Isnil<span style="color: #000000;">(</span> oMemo <span style="color: #000000;">)</span><br /> @ <span style="color: #000000;">180</span>,<span style="color: #000000;">740</span> RICHEDIT5 oMemo <span style="color: #0000ff;">VAR</span> cVar <span style="color: #0000ff;">of</span> oDlg <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">450</span>, <span style="color: #000000;">400</span> HIGHLIGHT<br /> <span style="color: #00C800;">endif</span><br /> oMemo:<span style="color: #000000;">LoadRTF</span><span style="color: #000000;">(</span> cStr, .F. <span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">NIL</span><br /> <br /> </div>[/code:1bhydo4d]
|
A sample to print with REPrintBox5 a memo on two pages ?
|
Cristobal ,
thank You very much.
With these changes it looks much better now <!-- s:shock: --><img src="{SMILIES_PATH}/icon_eek.gif" alt=":shock:" title="Shocked" /><!-- s:shock: -->
It will be next on my todolist.
I would like to add a button to show the sample from the memofield
in fullscreen-mode with a editor.
Just using wordpad or do You have a better idea ?
regards
Uwe <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D -->
|
A sample to print with REPrintBox5 a memo on two pages ?
|
Uwe,
Maybe a launce for a ceartin application like :
c:\multi\multiedit sample.prg (from browse) ?
Ofcource, a copy paste from a other solution will work also ))
Just a idea.
|
A sample to print with REPrintBox5 a memo on two pages ?
|
Marc,
Just a idea.
Using the setup-section and define the editor You are working with.
That will open the memo with Your favorite editor.
The memo will be saved as a textfile before and opend with Your editor
regards
Uwe <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D -->
|
A sample to print with REPrintBox5 a memo on two pages ?
|
Uwe,
This would totaly fit for my needs <!-- s:wink: --><img src="{SMILIES_PATH}/icon_wink.gif" alt=":wink:" title="Wink" /><!-- s:wink: --> <!-- s:wink: --><img src="{SMILIES_PATH}/icon_wink.gif" alt=":wink:" title="Wink" /><!-- s:wink: --> (Also others...)
A Second section for the option to start the sample ( for me this is simple the buildh.bat sample.prg would complete the tool !!
Edit : me sample.prg
Run : buildh sample.prg
as 2 input fields.
I would suggest not to go to far into this, just 1 start option for Edit en Run, because otherwise the sampler will become a other program.
Marc
|
A sample to print with REPrintBox5 a memo on two pages ?
|
Marc,
I added the editor-solution
Works PERFECT <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D --> <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D -->
I can open the memo with my program-editor defined in the setup-section.
[img:1yut1jwk]http://www.pflegeplus.com/IMAGES/Forum58.jpg[/img:1yut1jwk]
regards
Uwe <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D -->
|
A sample to print with REPrintBox5 a memo on two pages ?
|
Yes...
BTW : Wich program do you use to make those jpg's and balloons ?
|
A sample to print with REPrintBox5 a memo on two pages ?
|
Marc,
I'm using [color=#0000FF:27xi5wjq]SNAGIT[/color:27xi5wjq] ( commercial )
but I remember there is a program ( freeware ) that comes very close to it.
I have to look for it.
regards
Uwe <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D -->
|
A sample to print with REPrintBox5 a memo on two pages ?
|
Try this also
[code=fw:2ugqe0ng]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"FiveWin.ch"</span><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"RichEdi5.ch"</span><br /><br /><span style="color: #00C800;">Static</span> hDll<br /><span style="color: #00C800;">Static</span> oDlg<br /><span style="color: #00C800;">Static</span> oBrw<br /><span style="color: #00C800;">Static</span> oMemo<br /><br /><span style="color: #00C800;">function</span> Main<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">local</span> cTitle:=<span style="color: #ff0000;">"Test"</span><br /> <span style="color: #00C800;">local</span> cResult<br /> <span style="color: #00C800;">local</span> oFont, oBold<br /> <span style="color: #00C800;">local</span> oSay<br /> <span style="color: #00C800;">local</span> oCode<br /><br /> REQUEST DBFCDX<br /><br /> USE clients via <span style="color: #ff0000;">"DBFCDX"</span> <span style="color: #00C800;">NEW</span><br /><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">FONT</span> oFont <span style="color: #0000ff;">NAME</span> <span style="color: #ff0000;">"Courier New"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">8</span>,<span style="color: #000000;">15</span><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">FONT</span> oBold <span style="color: #0000ff;">NAME</span> <span style="color: #ff0000;">"Courier New"</span> BOLD <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">8</span>,<span style="color: #000000;">15</span><br /><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">FROM</span> <span style="color: #000000;">5</span>,<span style="color: #000000;">10</span> <span style="color: #0000ff;">TO</span> <span style="color: #000000;">50</span>, <span style="color: #000000;">170</span> <span style="color: #0000ff;">font</span> oFont <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"Test Color"</span><br /><br /> @ <span style="color: #000000;">10</span>, <span style="color: #000000;">10</span> <span style="color: #0000ff;">XBROWSE</span> oBrw <span style="color: #0000ff;">OF</span> oDlg ;<br /> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">350</span>, <span style="color: #000000;">200</span> <span style="color: #0000ff;">PIXEL</span> ;<br /> COLUMNS <span style="color: #ff0000;">'Name'</span>, <span style="color: #ff0000;">'Adress'</span>, <span style="color: #ff0000;">'Notes'</span> ;<br /> <span style="color: #0000ff;">ALIAS</span> <span style="color: #ff0000;">'CLIENTS'</span> NOBORDER<br /><br /> WITH OBJECT oBrw<br /><br /> :<span style="color: #000000;">nColDividerStyle</span> := LINESTYLE_LIGHTGRAY<br /> :<span style="color: #000000;">nRowDividerStyle</span> := LINESTYLE_LIGHTGRAY<br /> :<span style="color: #000000;">bClrRowFocus</span> := <span style="color: #000000;">{</span> || <span style="color: #000000;">{</span> CLR_BLACK, RGB<span style="color: #000000;">(</span><span style="color: #000000;">185</span>,<span style="color: #000000;">220</span>,<span style="color: #000000;">255</span><span style="color: #000000;">)</span> <span style="color: #000000;">}</span> <span style="color: #000000;">}</span><br /> :<span style="color: #000000;">nMarqueeStyle</span> := MARQSTYLE_HIGHLROWMS<br /><br /> :<span style="color: #000000;">bChange</span> := <span style="color: #000000;">{</span> || oSay:<span style="color: #0000ff;">refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>,showmemo<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /><br /> :<span style="color: #000000;">CreateFromCode</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> END<br /> @ <span style="color: #000000;">250</span>, <span style="color: #000000;">10</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #ff0000;">"Code"</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">(</span> oCode := SourceEdit<span style="color: #000000;">(</span> oMemo:<span style="color: #000000;">GetText</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> , <span style="color: #ff0000;">"Code"</span>, , <span style="color: #000000;">100</span>, <span style="color: #000000;">300</span>, <span style="color: #000000;">700</span>, <span style="color: #000000;">1160</span>, , , , , , , <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /><br /> @ <span style="color: #000000;">10</span>,<span style="color: #000000;">370</span> <span style="color: #0000ff;">SAY</span> oSay <span style="color: #0000ff;">PROMPT</span> clients->notes <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">200</span>, <span style="color: #000000;">80</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">COLOR</span> CLR_BLACK <span style="color: #0000ff;">update</span> <span style="color: #B900B9;">//TRANSPARENT</span><br /><br /> <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">CENTERED</span> <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">INIT</span> showmemo<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> close all<br /> FreeLibrary<span style="color: #000000;">(</span> hDll <span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">Return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #00C800;">function</span> showmemo<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">Local</span> cStr := <span style="color: #ff0000;">""</span><br /> <span style="color: #00C800;">local</span> cChange := <span style="color: #ff0000;">"FiveWin"</span> <span style="color: #B900B9;">// Word that we will look for</span><br /> <span style="color: #00C800;">local</span> cInto := <span style="color: #ff0000;">"<span style="color: #000000;">\h</span>ighlight1 FiveWin <span style="color: #000000;">\h</span>ighlight0"</span> <span style="color: #B900B9;">// Put Word in Color</span><br /> <span style="color: #00C800;">local</span> cText<br /> <span style="color: #00C800;">local</span> cVar := <span style="color: #ff0000;">""</span><br /><br /> cText := clients->notes<br /><br /> cStr += <span style="color: #ff0000;">"{<span style="color: #000000;">\r</span>tf1<span style="color: #000000;">\a</span>nsi<span style="color: #000000;">\a</span>nsicpg1252<span style="color: #000000;">\d</span>eff0<span style="color: #000000;">\n</span>ouicompat<span style="color: #000000;">\d</span>eflang3082{<span style="color: #000000;">\f</span>onttbl{<span style="color: #000000;">\f</span>0<span style="color: #000000;">\f</span>nil<span style="color: #000000;">\f</span>charset0 Tahoma;}}"</span><br /> cStr += <span style="color: #ff0000;">"{<span style="color: #000000;">\c</span>olortbl ;<span style="color: #000000;">\r</span>ed255<span style="color: #000000;">\g</span>reen0<span style="color: #000000;">\b</span>lue0;<span style="color: #000000;">\r</span>ed0<span style="color: #000000;">\g</span>reen0<span style="color: #000000;">\b</span>lue0;<span style="color: #000000;">\r</span>ed128<span style="color: #000000;">\g</span>reen64<span style="color: #000000;">\b</span>lue64;<span style="color: #000000;">\r</span>ed0<span style="color: #000000;">\g</span>reen0<span style="color: #000000;">\b</span>lue128;}"</span><br /> cStr += <span style="color: #ff0000;">"<span style="color: #000000;">\v</span>iewkind4<span style="color: #000000;">\u</span>c1"</span><br /> cStr += <span style="color: #ff0000;">"<span style="color: #000000;">\p</span>ard<span style="color: #000000;">\f</span>s20"</span> + <span style="color: #00C800;">if</span><span style="color: #000000;">(</span> Empty<span style="color: #000000;">(</span> cText <span style="color: #000000;">)</span>, <span style="color: #ff0000;">" "</span>, cText <span style="color: #000000;">)</span><br /> cStr += <span style="color: #ff0000;">"}"</span><br /> cStr := StrTran<span style="color: #000000;">(</span> cStr, cChange, cInto <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">if</span> hb_Isnil<span style="color: #000000;">(</span> oMemo <span style="color: #000000;">)</span><br /> @ <span style="color: #000000;">180</span>,<span style="color: #000000;">740</span> RICHEDIT5 oMemo <span style="color: #0000ff;">VAR</span> cVar <span style="color: #0000ff;">of</span> oDlg <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">450</span>, <span style="color: #000000;">400</span> HIGHLIGHT<br /> <span style="color: #00C800;">endif</span><br /> oMemo:<span style="color: #000000;">LoadRTF</span><span style="color: #000000;">(</span> cStr, .F. <span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">NIL</span><br /> </div>[/code:2ugqe0ng]
|
A sample to print with REPrintBox5 a memo on two pages ?
|
This is very close to what is wanted.
I get this error however : (when I try to save)
Application
===========
Path and name: C:\fwharb\samples\mycolor2.exe (32 bits)
Size: 3,895,808 bytes
Compiler version: Harbour 3.2.0dev (r1506171039)
FiveWin version: FWH 17.05
C compiler version: Borland/Embarcadero C++ 7.0 (32-bit)
Windows version: 6.1, Build 7601 Service Pack 1
Time from start: 0 hours 0 mins 58 secs
Error occurred at: 02/25/18, 19:37:21
Error description: Error BASE/1004 Message not found: TBTNBMP:OACTIVO
Args:
[ 1] = O TBTNBMP
Stack Calls
===========
Called from: => __ERRRT_SBASE( 0 )
Called from: ../../../tobject.prg => TBTNBMP:ERROR( 0 )
Called from: ../../../tobject.prg => (b)HBOBJECT( 0 )
Called from: ../../../tobject.prg => TBTNBMP:MSGNOTFOUND( 0 )
Called from: ../../../tobject.prg => TBTNBMP:OACTIVO( 0 )
Called from: .\source\function\MEMOEDIT.PRG => (b)SOURCEEDIT( 467 )
Called from: .\source\classes\BTNBMP.PRG => TBTNBMP:CLICK( 683 )
Called from: .\source\classes\BTNBMP.PRG => TBTNBMP:LBUTTONUP( 919 )
Called from: .\source\classes\CONTROL.PRG => TCONTROL:HANDLEEVENT( 1721 )
Called from: .\source\classes\BTNBMP.PRG => TBTNBMP:HANDLEEVENT( 1866 )
Called from: .\source\classes\WINDOW.PRG => _FWH( 3325 )
Called from: => DIALOGBOXINDIRECT( 0 )
Called from: .\source\classes\DIALOG.PRG => TDIALOG:ACTIVATE( 296 )
Called from: mycolor2.prg => MAIN( 96 )
|
A sample to print with REPrintBox5 a memo on two pages ?
|
You are right, it's my mistake
In Memoedit.prg
At moment, change in button "Save" ACTION ::oActivo: with oEditor variable
Please, change and add this code
[code=fw:3olglqq6]<div class="fw" id="{CB}" style="font-family: monospace;"><br /> @ <span style="color: #000000;">04</span>,<span style="color: #000000;">82</span> <span style="color: #0000ff;">BTNBMP</span> <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"<"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">16</span>,<span style="color: #000000;">16</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg NOBORDER <span style="color: #0000ff;">FONT</span> oFontWD2 ;<br /> <span style="color: #0000ff;">COLOR</span> CLR_BLACK, CLR_WHITE ;<br /> TOOLTIP FWString<span style="color: #000000;">(</span> <span style="color: #ff0000;">"Save"</span> <span style="color: #000000;">)</span> ; <span style="color: #B900B9;">//Save As</span><br /> <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">(</span> SaveFileSource<span style="color: #000000;">(</span> oEditor, oEditor:<span style="color: #000000;">cFileName</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /><br /><span style="color: #B900B9;">// and at end of memoedit.prg add</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">Static</span> <span style="color: #00C800;">Function</span> SaveFileSource<span style="color: #000000;">(</span> oEditor, cFile <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">if</span> Empty<span style="color: #000000;">(</span> cFile <span style="color: #000000;">)</span> .or. !Empty<span style="color: #000000;">(</span> <span style="color: #00C800;">At</span><span style="color: #000000;">(</span> <span style="color: #ff0000;">"noname"</span>, Lower<span style="color: #000000;">(</span> cFile <span style="color: #000000;">)</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> cFile := cGetFile32<span style="color: #000000;">(</span> <span style="color: #ff0000;">"Program file (*.prg) |*.prg|"</span> + ;<br /> <span style="color: #ff0000;">"Header file (*.ch) |*.ch|"</span> + ;<br /> <span style="color: #ff0000;">"Headers (*.h) |*.h|"</span> + ;<br /> <span style="color: #ff0000;">"Resources (*.rc) |*.rc|"</span> + ;<br /> <span style="color: #ff0000;">"Source Code C (*.c) |*.c|"</span> + ;<br /> <span style="color: #ff0000;">"Source Code C++ (*.cpp) |*.cpp|"</span> + ;<br /> <span style="color: #ff0000;">"C File (*.cxx) |*.cxx|"</span> + ;<br /> <span style="color: #ff0000;">"Harbour files (*.hrb) |*.hrb|"</span> + ;<br /> <span style="color: #ff0000;">"Templates (*.pvk) |*.pvk|"</span> + ;<br /> <span style="color: #ff0000;">"Text file (*.txt) |*.txt|"</span> + ;<br /> <span style="color: #ff0000;">"Configuration file (*.ini) |*.ini|"</span> + ;<br /> <span style="color: #ff0000;">"HTML Page file (*.html) |*.html|"</span> + ;<br /> <span style="color: #ff0000;">"HTM Page file (*.htm) |*.htm|"</span> + ;<br /> <span style="color: #ff0000;">"TPL Page Template file (*.tpl) |*.tpl|"</span> + ;<br /> <span style="color: #ff0000;">"XML file (*.xml) |*.xml|"</span>,;<br /> <span style="color: #ff0000;">"Save as"</span>, <span style="color: #000000;">0</span>, ;<br /> hb_CurDrive<span style="color: #000000;">(</span><span style="color: #000000;">)</span> + <span style="color: #ff0000;">":<span style="color: #000000;">\"</span> + CurDir(), .T., .T. )<br /> endif<br /> oEditor:Save( , , , , , cFile )<br /><br />Return nil<br /><br />//----------------------------------------------------------------------------//<br /><br /></span></div>[/code:3olglqq6]
|
A sample to print with REPrintBox5 a memo on two pages ?
|
Thanks.
Uwe, I let this for you to do because I never have changed stuff from FW prog's itself. (Maybe i have to link/compile them and that kind of stuff)
@ Cristobal : You may put a link to a Exe for me to test, but I get the idea. Mr. Uwe will implement it at a given moment.
|
A sample to print with REPrintBox5 a memo on two pages ?
|
[quote="Marc Venken":3r9uokiw]Thanks.
Uwe, I let this for you to do because I never have changed stuff from FW prog's itself. (Maybe i have to link/compile them and that kind of stuff)
@ Cristobal : You may put a link to a Exe for me to test, but I get the idea. Mr. Uwe will implement it at a given moment.[/quote:3r9uokiw]
Marc, for your test, too easy
Copy function SourceEdit from MEMOEDIT.PRG and paste it into your sample ( at end of document ) and put your modification
Compile and build normaly
|
A sample to print with REPrintBox5 a memo on two pages ?
|
Cristobal,
I did some changes to the sample
because of a colored dialog You can see that the memo gets repainted again and again
With my changes the memo is painted only once and after that a text replacement.
Maybe You can have a look at it
[code=fw:1kuytuq9]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"FiveWin.ch"</span><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"RichEdi5.ch"</span><br /><br /><span style="color: #00C800;">Static</span> oDlg, oBrw, oMemo<br /><br /><span style="color: #00C800;">FUNCTION</span> MAIN<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><span style="color: #00C800;">local</span> cTitle:=<span style="color: #ff0000;">"Test"</span><br /><span style="color: #00C800;">local</span> cResult, cText<br /><span style="color: #00C800;">local</span> oFont, oBold, oBrush<br /><span style="color: #00C800;">local</span> oSay, cFilter := <span style="color: #ff0000;">"FiveWin"</span><br /><br />REQUEST DBFCDX<br /><br />USE clients via <span style="color: #ff0000;">"DBFCDX"</span> <span style="color: #00C800;">NEW</span><br />cText := clients->notes<br /><br /><span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">FONT</span> oFont <span style="color: #0000ff;">NAME</span> <span style="color: #ff0000;">"Courier New"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">8</span>,<span style="color: #000000;">15</span><br /><span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">FONT</span> oBold <span style="color: #0000ff;">NAME</span> <span style="color: #ff0000;">"Courier New"</span> BOLD <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">8</span>,<span style="color: #000000;">15</span><br /><span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BRUSH</span> oBrush <span style="color: #0000ff;">COLOR</span> <span style="color: #000000;">16763283</span><br /><br /><span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">FROM</span> <span style="color: #000000;">5</span>,<span style="color: #000000;">10</span> <span style="color: #0000ff;">TO</span> <span style="color: #000000;">50</span>, <span style="color: #000000;">170</span> <span style="color: #0000ff;">font</span> oFont <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"Test Color"</span> <br /><br />@ <span style="color: #000000;">10</span>, <span style="color: #000000;">10</span> <span style="color: #0000ff;">XBROWSE</span> oBrw <span style="color: #0000ff;">OF</span> oDlg ;<br /> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">350</span>, <span style="color: #000000;">200</span> <span style="color: #0000ff;">PIXEL</span> ;<br /> COLUMNS <span style="color: #ff0000;">'Name'</span>, <span style="color: #ff0000;">'Adress'</span>, <span style="color: #ff0000;">'Notes'</span> ;<br /> <span style="color: #0000ff;">ALIAS</span> <span style="color: #ff0000;">'CLIENTS'</span> NOBORDER<br /><br />WITH OBJECT oBrw<br /> :<span style="color: #000000;">nColDividerStyle</span> := LINESTYLE_LIGHTGRAY<br /> :<span style="color: #000000;">nRowDividerStyle</span> := LINESTYLE_LIGHTGRAY<br /> :<span style="color: #000000;">bClrRowFocus</span> := <span style="color: #000000;">{</span> || <span style="color: #000000;">{</span> CLR_BLACK, RGB<span style="color: #000000;">(</span><span style="color: #000000;">185</span>,<span style="color: #000000;">220</span>,<span style="color: #000000;">255</span><span style="color: #000000;">)</span> <span style="color: #000000;">}</span> <span style="color: #000000;">}</span><br /> :<span style="color: #000000;">nMarqueeStyle</span> := MARQSTYLE_HIGHLROWMS<br /><br /> :<span style="color: #000000;">bChange</span> := <span style="color: #000000;">{</span> || oSay:<span style="color: #0000ff;">refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>, ;<br /> cText := clients->notes, oMemo:<span style="color: #000000;">SetText</span><span style="color: #000000;">(</span> cText <span style="color: #000000;">)</span>, ;<br /> oMemo:<span style="color: #000000;">LoadRTF</span><span style="color: #000000;">(</span> SHOWMEMO<span style="color: #000000;">(</span>cText, cFilter<span style="color: #000000;">)</span>, .F. <span style="color: #000000;">)</span>, ;<br /> oMemo:<span style="color: #000000;">GoToLine</span><span style="color: #000000;">(</span> <span style="color: #000000;">1</span> <span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /><br /> :<span style="color: #000000;">CreateFromCode</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br />END<br /><br />@ <span style="color: #000000;">10</span>, <span style="color: #000000;">370</span> <span style="color: #0000ff;">SAY</span> oSay <span style="color: #0000ff;">PROMPT</span> clients->notes <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">200</span>, <span style="color: #000000;">80</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">COLOR</span> CLR_BLACK <span style="color: #0000ff;">update</span> <span style="color: #B900B9;">//TRANSPARENT</span><br /><br />@ <span style="color: #000000;">120</span>,<span style="color: #000000;">370</span> RICHEDIT5 oMemo <span style="color: #0000ff;">VAR</span> cText <span style="color: #0000ff;">of</span> oDlg <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">250</span>, <span style="color: #000000;">200</span> <br /><br /><span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">CENTERED</span> <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">INIT</span> ;<br /><span style="color: #000000;">(</span> oDlg:<span style="color: #000000;">SetBrush</span><span style="color: #000000;">(</span> oBrush <span style="color: #000000;">)</span>, ;<br /> oMemo:<span style="color: #000000;">SetText</span><span style="color: #000000;">(</span> cText <span style="color: #000000;">)</span>, ;<br /> oMemo:<span style="color: #000000;">LoadRTF</span><span style="color: #000000;">(</span> SHOWMEMO<span style="color: #000000;">(</span>cText, cFilter<span style="color: #000000;">)</span>, .F. <span style="color: #000000;">)</span>, ;<br /> oMemo:<span style="color: #000000;">GoToLine</span><span style="color: #000000;">(</span> <span style="color: #000000;">1</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /><br /><span style="color: #0000ff;">RELEASE</span> <span style="color: #0000ff;">BRUSH</span> oBrush<br /><br />CLOSE ALL<br /><br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br /><br /><span style="color: #B900B9;">//----------------------</span><br /><br /><span style="color: #00C800;">FUNCTION</span> SHOWMEMO<span style="color: #000000;">(</span>cText, cFilter<span style="color: #000000;">)</span><br /><span style="color: #00C800;">Local</span> cStr := <span style="color: #ff0000;">""</span><br /><span style="color: #00C800;">local</span> cInto := <span style="color: #ff0000;">"<span style="color: #000000;">\h</span>ighlight1"</span> + cFilter + <span style="color: #ff0000;">"<span style="color: #000000;">\h</span>ighlight0"</span> <span style="color: #B900B9;">// Put Word in Color</span><br /><span style="color: #00C800;">local</span> cVar := <span style="color: #ff0000;">""</span><br /><br />cStr += <span style="color: #ff0000;">"{<span style="color: #000000;">\r</span>tf1<span style="color: #000000;">\a</span>nsi<span style="color: #000000;">\a</span>nsicpg1252<span style="color: #000000;">\d</span>eff0<span style="color: #000000;">\n</span>ouicompat<span style="color: #000000;">\d</span>eflang3082{<span style="color: #000000;">\f</span>onttbl{<span style="color: #000000;">\f</span>0<span style="color: #000000;">\f</span>nil<span style="color: #000000;">\f</span>charset0 Tahoma;}}"</span><br />cStr += <span style="color: #ff0000;">"{<span style="color: #000000;">\c</span>olortbl ;<span style="color: #000000;">\r</span>ed255<span style="color: #000000;">\g</span>reen0<span style="color: #000000;">\b</span>lue0;<span style="color: #000000;">\r</span>ed0<span style="color: #000000;">\g</span>reen0<span style="color: #000000;">\b</span>lue0;<span style="color: #000000;">\r</span>ed128<span style="color: #000000;">\g</span>reen64<span style="color: #000000;">\b</span>lue64;<span style="color: #000000;">\r</span>ed0<span style="color: #000000;">\g</span>reen0<span style="color: #000000;">\b</span>lue128;}"</span><br />cStr += <span style="color: #ff0000;">"<span style="color: #000000;">\v</span>iewkind4<span style="color: #000000;">\u</span>c1"</span><br />cStr += <span style="color: #ff0000;">"<span style="color: #000000;">\p</span>ard<span style="color: #000000;">\f</span>s20"</span> + <span style="color: #00C800;">if</span><span style="color: #000000;">(</span> Empty<span style="color: #000000;">(</span> cText <span style="color: #000000;">)</span>, <span style="color: #ff0000;">" "</span>, cText <span style="color: #000000;">)</span><br />cStr += <span style="color: #ff0000;">"}"</span><br />cStr := StrTran<span style="color: #000000;">(</span> cStr, cFilter, cInto <span style="color: #000000;">)</span> <span style="color: #B900B9;">// Word that we will look for</span><br /><br /><span style="color: #00C800;">RETURN</span> cStr<br /> </div>[/code:1kuytuq9]
regards
Uwe <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D -->
|
A sample to print with REPrintBox5 a memo on two pages ?
|
Cristobal,
I did some changes to the sample
because of a colored dialog You can see that the memo gets painted again and again
With my changes the memo is painted only once and after that a text replacement.
Maybe You can have a look at it
[code=fw:rckp7ty2]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"FiveWin.ch"</span><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"RichEdi5.ch"</span><br /><br /><span style="color: #00C800;">Static</span> oDlg, oBrw, oMemo<br /><br /><span style="color: #00C800;">FUNCTION</span> MAIN<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><span style="color: #00C800;">local</span> cTitle:=<span style="color: #ff0000;">"Test"</span><br /><span style="color: #00C800;">local</span> cResult, cText<br /><span style="color: #00C800;">local</span> oFont, oBold, oBrush<br /><span style="color: #00C800;">local</span> oSay, cFilter := <span style="color: #ff0000;">"FiveWin"</span><br /><br />REQUEST DBFCDX<br /><br />USE clients via <span style="color: #ff0000;">"DBFCDX"</span> <span style="color: #00C800;">NEW</span><br />cText := clients->notes<br /><br /><span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">FONT</span> oFont <span style="color: #0000ff;">NAME</span> <span style="color: #ff0000;">"Courier New"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">8</span>,<span style="color: #000000;">15</span><br /><span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">FONT</span> oBold <span style="color: #0000ff;">NAME</span> <span style="color: #ff0000;">"Courier New"</span> BOLD <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">8</span>,<span style="color: #000000;">15</span><br /><span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BRUSH</span> oBrush <span style="color: #0000ff;">COLOR</span> <span style="color: #000000;">16763283</span><br /><br /><span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">FROM</span> <span style="color: #000000;">5</span>,<span style="color: #000000;">10</span> <span style="color: #0000ff;">TO</span> <span style="color: #000000;">50</span>, <span style="color: #000000;">170</span> <span style="color: #0000ff;">font</span> oFont <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"Test Color"</span> <br /><br />@ <span style="color: #000000;">10</span>, <span style="color: #000000;">10</span> <span style="color: #0000ff;">XBROWSE</span> oBrw <span style="color: #0000ff;">OF</span> oDlg ;<br /> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">350</span>, <span style="color: #000000;">200</span> <span style="color: #0000ff;">PIXEL</span> ;<br /> COLUMNS <span style="color: #ff0000;">'Name'</span>, <span style="color: #ff0000;">'Adress'</span>, <span style="color: #ff0000;">'Notes'</span> ;<br /> <span style="color: #0000ff;">ALIAS</span> <span style="color: #ff0000;">'CLIENTS'</span> NOBORDER<br /><br />WITH OBJECT oBrw<br /> :<span style="color: #000000;">nColDividerStyle</span> := LINESTYLE_LIGHTGRAY<br /> :<span style="color: #000000;">nRowDividerStyle</span> := LINESTYLE_LIGHTGRAY<br /> :<span style="color: #000000;">bClrRowFocus</span> := <span style="color: #000000;">{</span> || <span style="color: #000000;">{</span> CLR_BLACK, RGB<span style="color: #000000;">(</span><span style="color: #000000;">185</span>,<span style="color: #000000;">220</span>,<span style="color: #000000;">255</span><span style="color: #000000;">)</span> <span style="color: #000000;">}</span> <span style="color: #000000;">}</span><br /> :<span style="color: #000000;">nMarqueeStyle</span> := MARQSTYLE_HIGHLROWMS<br /><br /> :<span style="color: #000000;">bChange</span> := <span style="color: #000000;">{</span> || oSay:<span style="color: #0000ff;">refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>, ;<br /> cText := clients->notes, oMemo:<span style="color: #000000;">SetText</span><span style="color: #000000;">(</span> cText <span style="color: #000000;">)</span>, ;<br /> oMemo:<span style="color: #000000;">LoadRTF</span><span style="color: #000000;">(</span> SHOWMEMO<span style="color: #000000;">(</span>cText, cFilter<span style="color: #000000;">)</span>, .F. <span style="color: #000000;">)</span>, ;<br /> oMemo:<span style="color: #000000;">GoToLine</span><span style="color: #000000;">(</span> <span style="color: #000000;">1</span> <span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /><br /> :<span style="color: #000000;">CreateFromCode</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br />END<br /><br />@ <span style="color: #000000;">10</span>, <span style="color: #000000;">370</span> <span style="color: #0000ff;">SAY</span> oSay <span style="color: #0000ff;">PROMPT</span> clients->notes <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">200</span>, <span style="color: #000000;">80</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">COLOR</span> CLR_BLACK <span style="color: #0000ff;">update</span> <span style="color: #B900B9;">//TRANSPARENT</span><br /><br />@ <span style="color: #000000;">120</span>,<span style="color: #000000;">370</span> RICHEDIT5 oMemo <span style="color: #0000ff;">VAR</span> cText <span style="color: #0000ff;">of</span> oDlg <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">250</span>, <span style="color: #000000;">200</span> <br /><br /><span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">CENTERED</span> <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">INIT</span> ;<br /><span style="color: #000000;">(</span> oDlg:<span style="color: #000000;">SetBrush</span><span style="color: #000000;">(</span> oBrush <span style="color: #000000;">)</span>, ;<br /> oMemo:<span style="color: #000000;">SetText</span><span style="color: #000000;">(</span> cText <span style="color: #000000;">)</span>, ;<br /> oMemo:<span style="color: #000000;">LoadRTF</span><span style="color: #000000;">(</span> SHOWMEMO<span style="color: #000000;">(</span>cText, cFilter<span style="color: #000000;">)</span>, .F. <span style="color: #000000;">)</span>, ;<br /> oMemo:<span style="color: #000000;">GoToLine</span><span style="color: #000000;">(</span> <span style="color: #000000;">1</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /><br /><span style="color: #0000ff;">RELEASE</span> <span style="color: #0000ff;">BRUSH</span> oBrush<br /><br />CLOSE ALL<br /><br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br /><br /><span style="color: #B900B9;">//----------------------</span><br /><br /><span style="color: #00C800;">FUNCTION</span> SHOWMEMO<span style="color: #000000;">(</span>cText, cFilter<span style="color: #000000;">)</span><br /><span style="color: #00C800;">Local</span> cStr := <span style="color: #ff0000;">""</span><br /><span style="color: #00C800;">local</span> cInto := <span style="color: #ff0000;">"<span style="color: #000000;">\h</span>ighlight1"</span> + cFilter + <span style="color: #ff0000;">"<span style="color: #000000;">\h</span>ighlight0"</span> <span style="color: #B900B9;">// Put Word in Color</span><br /><span style="color: #00C800;">local</span> cVar := <span style="color: #ff0000;">""</span><br /><br />cStr += <span style="color: #ff0000;">"{<span style="color: #000000;">\r</span>tf1<span style="color: #000000;">\a</span>nsi<span style="color: #000000;">\a</span>nsicpg1252<span style="color: #000000;">\d</span>eff0<span style="color: #000000;">\n</span>ouicompat<span style="color: #000000;">\d</span>eflang3082{<span style="color: #000000;">\f</span>onttbl{<span style="color: #000000;">\f</span>0<span style="color: #000000;">\f</span>nil<span style="color: #000000;">\f</span>charset0 Tahoma;}}"</span><br />cStr += <span style="color: #ff0000;">"{<span style="color: #000000;">\c</span>olortbl ;<span style="color: #000000;">\r</span>ed255<span style="color: #000000;">\g</span>reen0<span style="color: #000000;">\b</span>lue0;<span style="color: #000000;">\r</span>ed0<span style="color: #000000;">\g</span>reen0<span style="color: #000000;">\b</span>lue0;<span style="color: #000000;">\r</span>ed128<span style="color: #000000;">\g</span>reen64<span style="color: #000000;">\b</span>lue64;<span style="color: #000000;">\r</span>ed0<span style="color: #000000;">\g</span>reen0<span style="color: #000000;">\b</span>lue128;}"</span><br />cStr += <span style="color: #ff0000;">"<span style="color: #000000;">\v</span>iewkind4<span style="color: #000000;">\u</span>c1"</span><br />cStr += <span style="color: #ff0000;">"<span style="color: #000000;">\p</span>ard<span style="color: #000000;">\f</span>s20"</span> + <span style="color: #00C800;">if</span><span style="color: #000000;">(</span> Empty<span style="color: #000000;">(</span> cText <span style="color: #000000;">)</span>, <span style="color: #ff0000;">" "</span>, cText <span style="color: #000000;">)</span><br />cStr += <span style="color: #ff0000;">"}"</span><br />cStr := StrTran<span style="color: #000000;">(</span> cStr, cFilter, cInto <span style="color: #000000;">)</span> <span style="color: #B900B9;">// Word that we will look for</span><br /><br /><span style="color: #00C800;">RETURN</span> cStr<br /> </div>[/code:rckp7ty2]
regards
Uwe <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D -->
|
A sample to print with REPrintBox5 a memo on two pages ?
|
Uwe, your sample run OK for me
what's your problem?
I do not notice that the control is repainted
|
A sample to print with REPrintBox5 a memo on two pages ?
|
Ah!, sorry
Remove calls to the method SetText
[code=fw:19wcet53]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><br /> :<span style="color: #000000;">bChange</span> := <span style="color: #000000;">{</span> || oSay:<span style="color: #0000ff;">refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>, ;<br /> cText := clients->notes, ; <span style="color: #B900B9;">//oMemo:SetText( cText ), ;</span><br /> oMemo:<span style="color: #000000;">LoadRTF</span><span style="color: #000000;">(</span> SHOWMEMO<span style="color: #000000;">(</span>cText, cFilter<span style="color: #000000;">)</span>, .F. <span style="color: #000000;">)</span>, ;<br /> oMemo:<span style="color: #000000;">GoToLine</span><span style="color: #000000;">(</span> <span style="color: #000000;">1</span> <span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /><br /> :<span style="color: #000000;">CreateFromCode</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br />END<br /><br />@ <span style="color: #000000;">10</span>, <span style="color: #000000;">370</span> <span style="color: #0000ff;">SAY</span> oSay <span style="color: #0000ff;">PROMPT</span> clients->notes <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">200</span>, <span style="color: #000000;">80</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">COLOR</span> CLR_BLACK <span style="color: #B900B9;">//update //TRANSPARENT</span><br /><br />@ <span style="color: #000000;">120</span>,<span style="color: #000000;">370</span> RICHEDIT5 oMemo <span style="color: #0000ff;">VAR</span> cText <span style="color: #0000ff;">of</span> oDlg <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">250</span>, <span style="color: #000000;">200</span> <span style="color: #B900B9;">//HIGHLIGHT</span><br /><br /><span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">CENTERED</span> <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">INIT</span> ;<br /><span style="color: #000000;">(</span> oDlg:<span style="color: #000000;">SetBrush</span><span style="color: #000000;">(</span> oBrush <span style="color: #000000;">)</span>, ;<span style="color: #B900B9;">// oMemo:SetText( cText ), ;</span><br /> oMemo:<span style="color: #000000;">LoadRTF</span><span style="color: #000000;">(</span> SHOWMEMO<span style="color: #000000;">(</span>cText, cFilter<span style="color: #000000;">)</span>, .F. <span style="color: #000000;">)</span>, ;<br /> oMemo:<span style="color: #000000;">GoToLine</span><span style="color: #000000;">(</span> <span style="color: #000000;">1</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /><br /> </div>[/code:19wcet53]
|
A sample how to use DEFAULT-Positions in xBrowse-Arrays.
|
Hello,
There are some questions, about array-position in xbrowse
At first, once again thanks to Mr. Nageswaragunupudi
for his help
[img:2qo2kq8g]http://www.pflegeplus.com/pictures/default.jpg[/img:2qo2kq8g]
// Brush Dialog
// --------------------------------------
oBrw7 := TXBrowse():New( oDlg5 )
oBrw7:nMarqueeStyle := MARQSTYLE_HIGHLROW
oBrw7:nColDividerStyle := LINESTYLE_BLACK
oBrw7:nRowDividerStyle := LINESTYLE_BLACK
oBrw7:SetArray( aBRUSH2 )
oBrw7:aCols[ 1 ]:cHeader = Padr("No.", 3)
oBrw7:aCols[ 2 ]:cHeader = Padr("Select", 14)
oBrw7:lHScroll := .F.
oBrw7:lVScroll := .F.
// s_BRUSH2 is the old Position, when the user ended the browser.
// On a new start the 1. Col of the old position is YELLOW
// The Bar is on top
// -------------------------------------------------------------------------------
oBrw7:aCols[ 1 ]:bClrStd := {|| {CLR_BLACK, ;
IIF( oBrw7:nArrayAt = s_BRUSH2, CLR_YELLOW, CLR_WHITE ) } }
// When the user selects a brush, the var e_BRUSH2 remembers the
// new Position for the next start.
// This position will be YELLOW when the dialog is opend again.
// It is possible, to show a special Row with a defined color
// or jump directly to this row.
// -------------------------------------------------------------------------------
oBrw7:bLClicked := { | nRow, nCol | e_BRUSH2 := oBrw7:nRowSel }
oBrw7:aCols[ 2 ]:AddResource("Horizont")
oBrw7:aCols[ 2 ]:AddResource("Vertikal")
oBrw7:aCols[ 2 ]:AddResource("Fdiag")
oBrw7:aCols[ 2 ]:AddResource("Bdiag")
oBrw7:aCols[ 2 ]:AddResource("Cross")
oBrw7:aCols[ 2 ]:AddResource("Diacross")
oBrw7:aCols[ 2 ]:AddResource("Borland")
oBrw7:aCols[ 2 ]:AddResource("Tiled")
oBrw7:aCols[ 2 ]:bBmpData := {|| oBrw7:nArrayAt }
oBrw7:aCols[ 2 ]:bStrData := {|| oBrw7:aRow[2] }
oBrw7:CreateFromResource( 920 )
// I want to jump to the old ( default position )
// --------------------------------------------------------
REDEFINE BUTTONBMP oBtn8 ID 559 OF oDlg5 ;
ACTION ( oBrw7:nArrayAt := s_BRUSH2, oBrw7:nRowSel := s_BRUSH2, oBrw7:refresh() ) ;
BITMAP "Test_5" PROMPT SPACE(5) + "Set De&fault" TEXTRIGHT
oBtn8:cToolTip = { "Set the Row-Position" + CRLF + "to the old values", ;
"Set Default Positions", 1, CLR_BLACK, 14089979 }
Regards
Uwe <!-- s:lol: --><img src="{SMILIES_PATH}/icon_lol.gif" alt=":lol:" title="Laughing" /><!-- s:lol: -->
[/img]
|
A simple LLM using Harbour's hashes
|
An initial LLM ("large language model") using Harbour hashes:
llm.prg
[code=fw:p9s5asy6]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">static</span> hWords := <span style="color: #000000;">{</span>=><span style="color: #000000;">}</span><br /><br /><span style="color: #00C800;">function</span> Main<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> AddSentence<span style="color: #000000;">(</span> hWords, hb_ATokens<span style="color: #000000;">(</span> <span style="color: #ff0000;">"Hello my friend, Hello how are you ? Hello"</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /><br /> ? hWords<span style="color: #000000;">[</span> <span style="color: #ff0000;">"Hello"</span> <span style="color: #000000;">]</span><span style="color: #000000;">[</span> <span style="color: #000000;">2</span> <span style="color: #000000;">]</span><span style="color: #000000;">[</span> <span style="color: #ff0000;">"how"</span> <span style="color: #000000;">]</span> <br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #00C800;">function</span> AddSentence<span style="color: #000000;">(</span> hWords, aWords <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">local</span> cWord<br /> <br /> <span style="color: #00C800;">for</span> each cWord in aWords<br /> <span style="color: #00C800;">if</span> ! hb_HHasKey<span style="color: #000000;">(</span> hWords, cWord <span style="color: #000000;">)</span><br /> hWords<span style="color: #000000;">[</span> cWord <span style="color: #000000;">]</span> = <span style="color: #000000;">{</span> <span style="color: #000000;">1</span>, <span style="color: #000000;">{</span>=><span style="color: #000000;">}</span> <span style="color: #000000;">}</span><br /> <span style="color: #00C800;">else</span><br /> hWords<span style="color: #000000;">[</span> cWord <span style="color: #000000;">]</span><span style="color: #000000;">[</span> <span style="color: #000000;">1</span> <span style="color: #000000;">]</span>++<br /> <span style="color: #00C800;">endif</span><br /> AddSentence<span style="color: #000000;">(</span> hWords<span style="color: #000000;">[</span> cWord <span style="color: #000000;">]</span><span style="color: #000000;">[</span> <span style="color: #000000;">2</span> <span style="color: #000000;">]</span>, SubArray<span style="color: #000000;">(</span> aWords, HB_EnumIndex<span style="color: #000000;">(</span><span style="color: #000000;">)</span> + <span style="color: #000000;">1</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">next</span><br /> <br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span> <br /><br /><span style="color: #00C800;">function</span> SubArray<span style="color: #000000;">(</span> aArray, nStart <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">local</span> aSub := <span style="color: #000000;">{</span><span style="color: #000000;">}</span><br /> <br /> <span style="color: #00C800;">for</span> n = nStart <span style="color: #0000ff;">to</span> Len<span style="color: #000000;">(</span> aArray <span style="color: #000000;">)</span><br /> AAdd<span style="color: #000000;">(</span> aSub, aArray<span style="color: #000000;">[</span> n <span style="color: #000000;">]</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">next</span><br /> <br /><span style="color: #00C800;">return</span> aSub </div>[/code:p9s5asy6]
|
A simple LLM using Harbour's hashes
|
Dear Antonio,
[i:6n3h6id6]large language model[/i:6n3h6id6]
Can this model also be used with the copy & paste method to submit larger amounts of text to the ChatGPT prompt?
Is there any way to bypass the token limit of approximately 4000 per request here?
I haven't figured out yet if, when I'm within a chat and I post multiple "knowledge bases" there, all of them are considered, and I can input more text than 4000 tokens.
Also, I'm uncertain if, when I later open a chat, all the information will still be there?
Best regards,
Otto
[img:6n3h6id6]https://mybergland.com/fwforum/chatfw1.gif[/img:6n3h6id6]
|
A simple LLM using Harbour's hashes
|
Enhanced example:
[code=fw:11sdc4hr]<div class="fw" id="{CB}" style="font-family: monospace;">#xcommand <span style="color: #0000ff;">TEXT</span> <into:<span style="color: #0000ff;">TO</span>,INTO> <v> => <span style="color: #00D7D7;">#pragma</span> __cstream|<v>:=%s<br /><br /><span style="color: #00C800;">static</span> hWords := <span style="color: #000000;">{</span>=><span style="color: #000000;">}</span><br /><br /><span style="color: #00C800;">function</span> Main<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">local</span> cText := GetText<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">local</span> aSentences := hb_ATokens<span style="color: #000000;">(</span> cText, <span style="color: #ff0000;">"."</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">local</span> cSentence, cKey<br /><br /> <span style="color: #00C800;">for</span> each cSentence in aSentences<br /> AddSentence<span style="color: #000000;">(</span> hWords, hb_ATokens<span style="color: #000000;">(</span> cSentence <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">next</span> <br /><br /> <span style="color: #00C800;">for</span> each cKey in hb_HKeys<span style="color: #000000;">(</span> hWords <span style="color: #000000;">)</span><br /> ? cKey<br /> <span style="color: #00C800;">next</span> <br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #00C800;">function</span> AddSentence<span style="color: #000000;">(</span> hWords, aWords <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">local</span> cWord<br /> <br /> <span style="color: #00C800;">for</span> each cWord in aWords<br /> <span style="color: #00C800;">if</span> ! hb_HHasKey<span style="color: #000000;">(</span> hWords, cWord <span style="color: #000000;">)</span><br /> hWords<span style="color: #000000;">[</span> cWord <span style="color: #000000;">]</span> = <span style="color: #000000;">{</span> <span style="color: #000000;">1</span>, <span style="color: #000000;">{</span>=><span style="color: #000000;">}</span> <span style="color: #000000;">}</span><br /> <span style="color: #00C800;">else</span><br /> hWords<span style="color: #000000;">[</span> cWord <span style="color: #000000;">]</span><span style="color: #000000;">[</span> <span style="color: #000000;">1</span> <span style="color: #000000;">]</span>++<br /> <span style="color: #00C800;">endif</span><br /> AddSentence<span style="color: #000000;">(</span> hWords<span style="color: #000000;">[</span> cWord <span style="color: #000000;">]</span><span style="color: #000000;">[</span> <span style="color: #000000;">2</span> <span style="color: #000000;">]</span>, SubArray<span style="color: #000000;">(</span> aWords, HB_EnumIndex<span style="color: #000000;">(</span><span style="color: #000000;">)</span> + <span style="color: #000000;">1</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">next</span><br /> <br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span> <br /><br /><span style="color: #00C800;">function</span> SubArray<span style="color: #000000;">(</span> aArray, nStart <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">local</span> aSub := <span style="color: #000000;">{</span><span style="color: #000000;">}</span><br /> <br /> <span style="color: #00C800;">for</span> n = nStart <span style="color: #0000ff;">to</span> Len<span style="color: #000000;">(</span> aArray <span style="color: #000000;">)</span><br /> AAdd<span style="color: #000000;">(</span> aSub, aArray<span style="color: #000000;">[</span> n <span style="color: #000000;">]</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">next</span><br /> <br /><span style="color: #00C800;">return</span> aSub <br /><br /><span style="color: #00C800;">function</span> GetText<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">local</span> cText<br /> <br /> <span style="color: #0000ff;">TEXT</span> INTO cText<br />Hello my friend, how are you ? Nice <span style="color: #0000ff;">to</span> meet you again. I hope that you are fine.<br /> ENDTEXT<br /><br /><span style="color: #00C800;">return</span> cText<br /> </div>[/code:11sdc4hr]
|
A simple LLM using Harbour's hashes
|
Dear Otto,
This is just a very simple example to understand how to build a very simple LLM
|
A simple LLM using Harbour's hashes
|
Dear Antonio,
Here, with a passing knowledge base, you see, I ask the same question twice.
By sending the knowledge base, I also receive a perfect response.
What I would like is to send the entire FIVEWIN documentation, but it is much larger than the 4000 tokens.
Best regards,
Otto
[img:1qzc7eos]https://mybergland.com/fwforum/udb.jpg[/img:1qzc7eos]
[img:1qzc7eos]https://mybergland.com/fwforum/udb1.jpg[/img:1qzc7eos]
|
A simple LLM using Harbour's hashes
|
Dear Antonio,
Somewhere I read that it is possible to link a web page as knowledge base.
Maybe someone knows how to do it.
Then we could have all the documentation linked in a single page.
Best regards,
Otto
|
A simple LLM using Harbour's hashes
|
Enhanced version thanks to Mr. Rao
[code=fw:j2dsu8oc]<div class="fw" id="{CB}" style="font-family: monospace;">#xcommand <span style="color: #0000ff;">TEXT</span> <into:<span style="color: #0000ff;">TO</span>,INTO> <v> => <span style="color: #00D7D7;">#pragma</span> __cstream|<v>:=%s<br /><br /><span style="color: #00C800;">static</span> hWords := <span style="color: #000000;">{</span>=><span style="color: #000000;">}</span><br /><br /><span style="color: #00C800;">function</span> Main<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">local</span> cText := GetText<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">local</span> aSentences := hb_ATokens<span style="color: #000000;">(</span> cText, <span style="color: #ff0000;">"."</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">local</span> cSentence, cKey<br /><br /> <span style="color: #00C800;">for</span> each cSentence in aSentences<br /> AddSentence<span style="color: #000000;">(</span> hWords, hb_ATokens<span style="color: #000000;">(</span> cSentence <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">next</span> <br /><br /> ? hWords<br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #00C800;">function</span> AddSentence<span style="color: #000000;">(</span> hWords, aWords, nStart <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">local</span> cWord, n<br /><br /> <span style="color: #00C800;">if</span> nStart == <span style="color: #00C800;">nil</span><br /> nStart = <span style="color: #000000;">1</span><br /> <span style="color: #00C800;">endif</span> <br /><br /> <span style="color: #00C800;">for</span> n := nStart <span style="color: #0000ff;">to</span> Len<span style="color: #000000;">(</span> aWords <span style="color: #000000;">)</span> <span style="color: #B900B9;">//each cWord in aWords</span><br /> cWord := aWords<span style="color: #000000;">[</span> n <span style="color: #000000;">]</span><br /> <span style="color: #00C800;">if</span> ! hb_HHasKey<span style="color: #000000;">(</span> hWords, cWord <span style="color: #000000;">)</span><br /> hWords<span style="color: #000000;">[</span> cWord <span style="color: #000000;">]</span> = <span style="color: #000000;">{</span> <span style="color: #000000;">1</span>, <span style="color: #000000;">{</span>=><span style="color: #000000;">}</span> <span style="color: #000000;">}</span><br /> <span style="color: #00C800;">else</span><br /> hWords<span style="color: #000000;">[</span> cWord <span style="color: #000000;">]</span><span style="color: #000000;">[</span> <span style="color: #000000;">1</span> <span style="color: #000000;">]</span>++<br /> <span style="color: #00C800;">endif</span><br /> <span style="color: #00C800;">if</span> n < Len<span style="color: #000000;">(</span> aWords <span style="color: #000000;">)</span><br /> AddSentence<span style="color: #000000;">(</span> hWords<span style="color: #000000;">[</span> cWord <span style="color: #000000;">]</span><span style="color: #000000;">[</span> <span style="color: #000000;">2</span> <span style="color: #000000;">]</span>, aWords, n + <span style="color: #000000;">1</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span><br /> <span style="color: #00C800;">next</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #00C800;">function</span> GetText<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">local</span> cText<br /> <br /> <span style="color: #0000ff;">TEXT</span> INTO cText<br />Hello my friend ? How are you ? Nice <span style="color: #0000ff;">to</span> meet you again.<br /> ENDTEXT<br /><br /><span style="color: #00C800;">return</span> cText<br /><br /> </div>[/code:j2dsu8oc]
|
A simple month calendar
|
[img:twzt073y]http://img66.imageshack.us/img66/2473/screenshotcalendar1yf2.png[/img:twzt073y]work in progress but now has slightly neater code and code to increment by any number of months (forward or backwards) and the same for years. That code looks slightly complicated but its to allow for leap years.MoveYears( iIncrement), it has just occurred to me, could be implemented as:[code:twzt073y]METHOD MoveYears( iIncrement ) CLASS CALENDAR
::MoveNonths( iIncrement * 12 )
RETURN nil [/code:twzt073y]
MoveMonths() could be implemented in a simpler manner if you don't want to allow maintining a highlight on a certain day of the month as a possibility.
Here is the code (dirty) as it stands:
[code:twzt073y]// Calendar.prg
#include "FiveLinuxDF.ch"
#include "hbclass.ch"
#define GTK_NORMAL 0
#define GTK_ACTIVE 1
#define GTK_PRELIGHT 2
#define GTK_SELECTED 3
#define GTK_INSENSITIVE 4
CLASS CALENDAR
DATA aDATEBUTTONS
DATA aDOW
DATA dAnchorDate
DATA iStartOfMonth
DATA iEndOfMonth
DATA grp_CALENDAR
METHOD New() CONSTRUCTOR
METHOD Show()
METHOD SetButtons()
METHOD SetAnchorDate( dDate )
METHOD MoveMonths( iIncrement )
METHOD MoveYears( iIncrement )
ENDCLASS
METHOD New() CLASS CALENDAR
::SetAnchorDate( DATE() )
::aDATEBUTTONS := ARRAY( 37 )
::aDOW := { "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" }
Return self
METHOD Show() CLASS CALENDAR
LOCAL dlg_CALENDAR
LOCAL sTitle
LOCAL ii
LOCAL oBtn
sTitle := "Calendar"
DEFINE DIALOG dlg_CALENDAR TITLE sTitle SIZE 400, 500
@ 90, 10 GROUP ::grp_CALENDAR LABEL "Calendar" OF dlg_CALENDAR SIZE 370, 250 PIXEL
iRow := 120
iCol = 20
FOR ii = -6 TO 37
IF ii > 0
@ iRow, iCol BUTTON ::aDATEBUTTONS[ii] PROMPT "Test" OF dlg_CALENDAR PIXEL SIZE 40, 25 NORMAL "aquamarine" PRELIGHT "medium aquamarine"
ELSE
@ iRow, iCol BUTTON oBtn PROMPT ::aDOW[ii + 7] OF dlg_CALENDAR PIXEL SIZE 40, 25 WHEN .F.
oBtn:SetBackgroundColor( "yellow", GTK_INSENSITIVE )
ENDIF
iCol += 50
IF iCol > 330
iRow += 30
iCol := 20
ENDIF
NEXT
@360, 10 BUTTON "Previous Month" OF dlg_CALENDAR PIXEL SIZE 120, 27 ACTION ::MoveMonths( -1 )
@360,250 BUTTON "Following Month" OF dlg_CALENDAR PIXEL SIZE 120, 27 ACTION ::MoveMonths( 1 )
@400, 10 BUTTON "Previous Year" OF dlg_CALENDAR PIXEL SIZE 120, 27 ACTION ::MoveYears( -1 )
@400,250 BUTTON "Following Year" OF dlg_CALENDAR PIXEL SIZE 120, 27 ACTION ::MoveYears( 1 )
ACTIVATE DIALOG dlg_CALENDAR ON INIT ::SetButtons()
RETURN nil
METHOD SetButtons() CLASS CALENDAR
FOR ii = 1 TO 37
DO CASE
CASE ii < ::iStartOfMonth
::aDATEBUTTONS[ii]:Hide()
CASE ii > ::iEndOfMonth
::aDATEBUTTONS[ii]:Hide()
OTHERWISE
::aDATEBUTTONS[ii]:SetText( ALLTRIM( STR( ii - ::iStartOfMonth + 1 ) ) )
::aDATEBUTTONS[ii]:Show()
ENDCASE
NEXT
::grp_CALENDAR:SetText( CMONTH( ::dAnchorDate ) + " " + STR( YEAR( ::dAnchorDate ) ) )
RETURN nil
METHOD SetAnchorDate( dDate ) CLASS CALENDAR
::dAnchorDate := dDate
::iStartOfMonth := DOW( BOM( dDate ) )
::iEndOfMonth := DaysInMonth( MONTH( dDate ), IsLeap( dDate ) ) + ::iStartOfMonth -1
RETURN nil
METHOD MoveMonths( iIncrement ) CLASS CALENDAR
iTemp := MONTH( ::dAnchorDate ) + iIncrement
iNewMonth := iTemp % 12
IF iNewMonth == 0
iNewMonth := 12
ENDIF
iNewYear := YEAR( ::dAnchorDate ) + ( ( iTemp - iNewMonth ) / 12 )
dTestDate := CTOD( "01/01/" + STR( iNewYear, 4, 0 ) )
iNewDay := MIN( DAY( ::dAnchorDate ), DaysInMonth( iNewMonth, IsLeap( dTestDate ) ) )
::SetAnchorDate( CTOD( PADL( ALLTRIM( STR( iNewDay, 2, 0 ) ), 2 ) + "/" + PADL( ALLTRIM( STR( iNewMonth, 2, 0 ) ), 2 ) + "/" + STR( iNewYear, 4, 0 ) ) )
::SetButtons()
RETURN nil
METHOD MoveYears( iIncrement ) CLASS CALENDAR
iNewYear := YEAR( ::dAnchorDate ) + iIncrement
dTestDate := CTOD( "01/01/" + STR( iNewYear, 4, 0 ) )
iNewDay := MIN( DAY( ::dAnchorDate ), DaysInMonth( MONTH( ::dAnchorDate ), IsLeap( dTestDate ) ) )
::SetAnchorDate( CTOD( PADL( ALLTRIM( STR( iNewDay, 2, 0 ) ), 2 ) + "/" + PADL( ALLTRIM( STR( MONTH( ::dAnchorDate ), 2, 0 ) ), 2 ) + "/" + STR( iNewYear, 4, 0 ) ) )
::SetButtons()
RETURN nil[/code:twzt073y]RegardsxProgrammer
|
A simple month calendar
|
Doug,Thanks for sharing it! <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
|
A simple month calendar
|
Hi allI discovered a small glitch in my code. It occurred when MoveMonths() was used to move backwards enough for iTemp to go negative. This of course only happened when the move was back more than 1 month (which couldn't happen in the version given above).The problem is with the % operator.-5 % 12 is giving -5 whereas I would have expected +7.So the code can be corrected as follows. Replace:[code:2z5egdyp] iNewMonth := iTemp % 12[/code:2z5egdyp]
With:
[code:2z5egdyp]IF iTemp >= 0
iNewMonth := iTemp % 12
ELSE
iNewMonth := 12 + (iTemp % 12 )
ENDIF[/code:2z5egdyp]RegardsDoug(xProgrammer)
|
A slider solution to adjust the color brightness ?
|
Is there any easy slider-solution <!-- s:?: --><img src="{SMILIES_PATH}/icon_question.gif" alt=":?:" title="Question" /><!-- s:?: -->
I created a function, but a little bit complicated.
The rest of the gradientpainter is working
Now I can select any background
maybe a calculation of the basic-RGB-value possible ?
[img:39hf5xpy]http://www.service-fivewin.de/images/Slider1.jg[/img:39hf5xpy]
[img:39hf5xpy]http://www.service-fivewin.de/images/Slider2.jg[/img:39hf5xpy]
I tested saving and loading the basic-gradientbitmap
next using the nrow position from the slider to get the color
FUNCTION GETCOLOR( nRow, nCol, oBmp )
LOCAL hDC := CreateCompatibleDC( oBmp:GetDC() )
LOCAL hBmp := ReadBitmap( 0, "Picker.bmp" ) // the basic gradient bmp
LOCAL hOldBmp := SelectObject( hDC, hBmp )
LOCAL nRGBColor := GetPixel( hDC, nCol, nRow )
SelectObject( hDC, hOldBmp )
DeleteObject( hBmp )
DeleteDC( hDC )
oBmp:ReleaseDC()
RETURN nRGBColor
best regards
Uwe <!-- s:?: --><img src="{SMILIES_PATH}/icon_question.gif" alt=":?:" title="Question" /><!-- s:?: -->
|
A slider solution to adjust the color brightness ?
|
Dear Uwe,
Your function code seems correct, is it working fine ?
Great work!
|
A slider solution to adjust the color brightness ?
|
Dear Antonio,
now I'm using a double-solution for the color-adjustment
1. on image-click
2. optional on slider-position
the sliderposition is adjusted to the position on imageclick
the clickposition inside the slider must
be the same like inside the image <!-- s:!: --><img src="{SMILIES_PATH}/icon_exclaim.gif" alt=":!:" title="Exclamation" /><!-- s:!: -->
the column-position is a given value
[color=#0000FF:24wg6gwi]Pickvalues := PICK_COLOR( nSlidPos * 22, 8, oBmp ),[/color:24wg6gwi]
because the bitmap is painted is that needed <!-- s:?: --><img src="{SMILIES_PATH}/icon_question.gif" alt=":?:" title="Question" /><!-- s:?: -->
( save and restore )
oBmp:SaveToBmp( "Picker.bmp" )
hBmp := ReadBitmap( 0, "Picker.Bmp" )
[img:24wg6gwi]http://www.service-fivewin.de/images/Slider3.jg[/img:24wg6gwi]
[code=fw:24wg6gwi]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00D7D7;">#Include</span> <span style="color: #ff0000;">"FiveWin.ch"</span><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"Slider.ch"</span><br /><br /><span style="color: #00C800;">STATIC</span> oDlg<br /><br /><span style="color: #B900B9;">// ---------------------------</span><br /><br /><span style="color: #00C800;">FUNCTION</span> Main<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><span style="color: #00C800;">LOCAL</span> oBmp, oSlider, nSlidPos, oCGet1, oCGet2, oCSay, nPickcolor, cPickcolor<br /><span style="color: #00C800;">LOCAL</span> oFont, oPos, Pickvalues, cGrdCol, nPos, nGrdCol := <span style="color: #000000;">255</span> <span style="color: #B900B9;">// RED</span><br /><br /><span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">FONT</span> oFont <span style="color: #0000ff;">NAME</span> <span style="color: #ff0000;">"Tahoma"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">0</span>, <span style="color: #000000;">-16</span> BOLD<br /><br /><span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"Testing colorchange "</span> + FWVERSION ;<br /><span style="color: #0000ff;">FROM</span> <span style="color: #000000;">1</span>, <span style="color: #000000;">1</span> <span style="color: #0000ff;">TO</span> <span style="color: #000000;">430</span>, <span style="color: #000000;">300</span> <span style="color: #0000ff;">PIXEL</span><br /><br />nPos := <span style="color: #000000;">0.5</span><br /><br />cGrdCol := <span style="color: #ff0000;">"nRGB( "</span> + ALLTRIM<span style="color: #000000;">(</span>STR<span style="color: #000000;">(</span>nRGBRed<span style="color: #000000;">(</span> <span style="color: #000000;">255</span> <span style="color: #000000;">)</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span> + <span style="color: #ff0000;">", "</span> + ;<br /> ALLTRIM<span style="color: #000000;">(</span>STR<span style="color: #000000;">(</span>nRGBGreen<span style="color: #000000;">(</span> <span style="color: #000000;">255</span> <span style="color: #000000;">)</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span> + <span style="color: #ff0000;">", "</span> + ;<br /> ALLTRIM<span style="color: #000000;">(</span>STR<span style="color: #000000;">(</span>nRGBBlue<span style="color: #000000;">(</span> <span style="color: #000000;">255</span> <span style="color: #000000;">)</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span> + <span style="color: #ff0000;">" )"</span><br /><br />@ <span style="color: #000000;">145</span>, <span style="color: #000000;">45</span> <span style="color: #0000ff;">SAY</span> oCSay <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">" "</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">60</span>, <span style="color: #000000;">12</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">FONT</span> oFont BORDER <span style="color: #0000ff;">UPDATE</span><br />oCSay:<span style="color: #000000;">SetColor</span><span style="color: #000000;">(</span> <span style="color: #000000;">0</span>, nGrdCol <span style="color: #000000;">)</span><br />@ <span style="color: #000000;">160</span>, <span style="color: #000000;">45</span> <span style="color: #0000ff;">GET</span> oCGet1 <span style="color: #0000ff;">VAR</span> nGrdCol <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">60</span>, <span style="color: #000000;">10</span> <span style="color: #0000ff;">PICTURE</span> <span style="color: #ff0000;">"99999999"</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">FONT</span> oFont <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">UPDATE</span> <br />@ <span style="color: #000000;">173</span>, <span style="color: #000000;">45</span> <span style="color: #0000ff;">GET</span> oCGet2 <span style="color: #0000ff;">VAR</span> cGrdCol <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">85</span>, <span style="color: #000000;">10</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">FONT</span> oFont <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">UPDATE</span> <br /><br />@ <span style="color: #000000;">68</span>, <span style="color: #000000;">95</span> <span style="color: #0000ff;">SAY</span> oPos <span style="color: #0000ff;">PROMPT</span> nPos <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">25</span>, <span style="color: #000000;">12</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">FONT</span> oFont BORDER <span style="color: #0000ff;">UPDATE</span><br /><br />@ <span style="color: #000000;">15</span>, <span style="color: #000000;">45</span> BITMAP oBmp FILENAME <span style="color: #00C800;">NIL</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">25</span>, <span style="color: #000000;">115</span> <span style="color: #0000ff;">OF</span> oDlg ;<br /><span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">ADJUST</span> BORDER <span style="color: #0000ff;">UPDATE</span><br />oBmp:<span style="color: #000000;">bPainted</span> := <span style="color: #000000;">{</span> |hDC| DRAW_BMP<span style="color: #000000;">(</span> hDC, oBmp, nGrdCol <span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br />oBmp:<span style="color: #000000;">bLClicked</span> := <span style="color: #000000;">{</span> | nRow, nCol | nPos := nRow / <span style="color: #000000;">220</span>, oPos:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>, ; <br /> oBmp:<span style="color: #000000;">SaveToBmp</span><span style="color: #000000;">(</span> <span style="color: #ff0000;">"Picker.bmp"</span> <span style="color: #000000;">)</span>, ; <br /> Pickvalues := PICK_COLOR<span style="color: #000000;">(</span> nRow, nCol, oBmp, nPos <span style="color: #000000;">)</span>, ; <br /> nGrdCol := Pickvalues<span style="color: #000000;">[</span><span style="color: #000000;">1</span><span style="color: #000000;">]</span>, ; <br /> cGrdCol := Pickvalues<span style="color: #000000;">[</span><span style="color: #000000;">2</span><span style="color: #000000;">]</span>, ; <br /> oCSay:<span style="color: #000000;">SetColor</span><span style="color: #000000;">(</span> <span style="color: #000000;">0</span>, nGrdCol <span style="color: #000000;">)</span>, oCSay:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>, ; <br /> oCGet1:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>, oCGet2:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>, ; <br /> oSlider:<span style="color: #000000;">Set</span><span style="color: #000000;">(</span> nRow / <span style="color: #000000;">22</span> <span style="color: #000000;">)</span>, oSlider:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /><br /><br /><br />nSlidPos := <span style="color: #000000;">5</span><br /><span style="color: #B900B9;">// MsgAlert( nSlidPos[1], "Slider-Row" ) , ; // 110 = 5 x 22</span><br />@ <span style="color: #000000;">10</span>, <span style="color: #000000;">70</span> SLIDER oSlider <span style="color: #0000ff;">VAR</span> nSlidPos <span style="color: #0000ff;">OF</span> oDlg ;<br /> <span style="color: #0000ff;">VERTICAL</span> ;<br /> RANGE <span style="color: #000000;">0</span>, <span style="color: #000000;">10</span> ;<br /> COLORS CLR_RED, <span style="color: #000000;">12632256</span>, CLR_CYAN ;<br /> MARKS <span style="color: #000000;">20</span> ;<br /> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">18</span>, <span style="color: #000000;">125</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">UPDATE</span> ;<br /> <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">CHANGE</span> <span style="color: #000000;">(</span> nPos := nSlidPos / <span style="color: #000000;">10</span>, oPos:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>, ; <br /> oBmp:<span style="color: #000000;">SaveToBmp</span><span style="color: #000000;">(</span> <span style="color: #ff0000;">"Picker.bmp"</span> <span style="color: #000000;">)</span>, ; <br /> Pickvalues := PICK_COLOR<span style="color: #000000;">(</span> nSlidPos * <span style="color: #000000;">22</span>, <span style="color: #000000;">8</span>, oBmp, nPos <span style="color: #000000;">)</span>, ; <br /> nGrdCol := Pickvalues<span style="color: #000000;">[</span><span style="color: #000000;">1</span><span style="color: #000000;">]</span>, ; <br /> cGrdCol := Pickvalues<span style="color: #000000;">[</span><span style="color: #000000;">2</span><span style="color: #000000;">]</span>, ; <br /> oCSay:<span style="color: #000000;">SetColor</span><span style="color: #000000;">(</span> <span style="color: #000000;">0</span>, nGrdCol <span style="color: #000000;">)</span>, oCSay:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>, ; <br /> oCGet1:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>, oCGet2:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /><br />@ <span style="color: #000000;">195</span>, <span style="color: #000000;">90</span> <span style="color: #0000ff;">BTNBMP</span> <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"&EXIT"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">50</span>, <span style="color: #000000;">15</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #000000;">2007</span>;<br /> TOP <span style="color: #0000ff;">ACTION</span> oDlg:<span style="color: #000000;">End</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /><span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">CENTERED</span><br /><br />oFont:<span style="color: #000000;">End</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br /><br /><span style="color: #B900B9;">//------------- BMP-Brush -----------</span><br /><br /><span style="color: #00C800;">FUNCTION</span> DRAW_BMP<span style="color: #000000;">(</span> hDC, oBitmap, nColor <span style="color: #000000;">)</span> <br /><span style="color: #00C800;">LOCAL</span> oBMPBrush, aGrad <br /><span style="color: #00C800;">LOCAL</span> aRect := GETCLIENTRECT<span style="color: #000000;">(</span> oBitmap:<span style="color: #000000;">hWnd</span> <span style="color: #000000;">)</span><br /><br />aGrad := <span style="color: #000000;">{</span> <span style="color: #000000;">{</span> .<span style="color: #000000;">5</span>, CLR_WHITE, nColor <span style="color: #000000;">}</span>, <span style="color: #000000;">{</span> .<span style="color: #000000;">5</span>, nColor, CLR_BLACK <span style="color: #000000;">}</span> <span style="color: #000000;">}</span><br /><br /><span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BRUSH</span> oBMPBrush ;<br /><span style="color: #0000ff;">COLOR</span> GradientFill<span style="color: #000000;">(</span> hDC, <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span>, aRect<span style="color: #000000;">[</span><span style="color: #000000;">3</span><span style="color: #000000;">]</span>, aRect<span style="color: #000000;">[</span><span style="color: #000000;">4</span><span style="color: #000000;">]</span>, aGrad, .T. <span style="color: #000000;">)</span> <span style="color: #B900B9;">// .T: = Vertical</span><br />oBMPBrush:<span style="color: #000000;">End</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">RETURN</span><span style="color: #000000;">(</span> <span style="color: #00C800;">NIL</span> <span style="color: #000000;">)</span><br /><br /><span style="color: #B900B9;">//---------</span><br /><br /><span style="color: #00C800;">FUNCTION</span> PICK_COLOR<span style="color: #000000;">(</span> nRow, nCol, oBmp, nPos <span style="color: #000000;">)</span><br /><span style="color: #00C800;">LOCAL</span> hDC := CreateCompatibleDC<span style="color: #000000;">(</span> oBmp:<span style="color: #000000;">GetDC</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /><span style="color: #00C800;">LOCAL</span> hBmp, nColor, hOldBmp, aValues<span style="color: #000000;">[</span><span style="color: #000000;">4</span><span style="color: #000000;">]</span><br /><br />hBmp := ReadBitmap<span style="color: #000000;">(</span> <span style="color: #000000;">0</span>, <span style="color: #ff0000;">"Picker.Bmp"</span> <span style="color: #000000;">)</span><br />hOldBmp := SelectObject<span style="color: #000000;">(</span> hDC, hBmp <span style="color: #000000;">)</span><br /><br />aValues<span style="color: #000000;">[</span><span style="color: #000000;">1</span><span style="color: #000000;">]</span> := GetPixel<span style="color: #000000;">(</span> hDC, nCol, nRow <span style="color: #000000;">)</span><br /><span style="color: #00C800;">IF</span> nPos = <span style="color: #000000;">0</span><br /> aValues<span style="color: #000000;">[</span><span style="color: #000000;">1</span><span style="color: #000000;">]</span> := <span style="color: #000000;">16777215</span> <span style="color: #B900B9;">// white</span><br /><span style="color: #00C800;">ENDIF</span><br /><span style="color: #00C800;">IF</span> nPos = <span style="color: #000000;">1</span> <br /> aValues<span style="color: #000000;">[</span><span style="color: #000000;">1</span><span style="color: #000000;">]</span> := <span style="color: #000000;">0</span> <span style="color: #B900B9;">// black</span><br /><span style="color: #00C800;">ENDIF</span><br />SelectObject<span style="color: #000000;">(</span> hDC, hOldBmp <span style="color: #000000;">)</span><br />DeleteObject<span style="color: #000000;">(</span> hBmp <span style="color: #000000;">)</span><br />DeleteDC<span style="color: #000000;">(</span> hDC <span style="color: #000000;">)</span><br />oBmp:<span style="color: #000000;">ReleaseDC</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br />nRed := nRGBRed<span style="color: #000000;">(</span> aValues<span style="color: #000000;">[</span><span style="color: #000000;">1</span><span style="color: #000000;">]</span> <span style="color: #000000;">)</span><br />nGreen := nRGBGreen<span style="color: #000000;">(</span>aValues<span style="color: #000000;">[</span><span style="color: #000000;">1</span><span style="color: #000000;">]</span> <span style="color: #000000;">)</span><br />nBlue := nRGBBlue<span style="color: #000000;">(</span> aValues<span style="color: #000000;">[</span><span style="color: #000000;">1</span><span style="color: #000000;">]</span> <span style="color: #000000;">)</span><br /> <br />aValues<span style="color: #000000;">[</span><span style="color: #000000;">2</span><span style="color: #000000;">]</span> := <span style="color: #ff0000;">"nRGB( "</span> + ALLTRIM<span style="color: #000000;">(</span>STR<span style="color: #000000;">(</span>nRed<span style="color: #000000;">)</span><span style="color: #000000;">)</span> + <span style="color: #ff0000;">", "</span> + ;<br /> ALLTRIM<span style="color: #000000;">(</span>STR<span style="color: #000000;">(</span>nGreen<span style="color: #000000;">)</span><span style="color: #000000;">)</span> + <span style="color: #ff0000;">", "</span> + ;<br /> ALLTRIM<span style="color: #000000;">(</span>STR<span style="color: #000000;">(</span>nBlue<span style="color: #000000;">)</span><span style="color: #000000;">)</span> + <span style="color: #ff0000;">" )"</span><br /><br /><span style="color: #B900B9;">//MsgAlert( nRow, "Img-Row" ) // 110 = 0.5</span><br /><br /><span style="color: #00C800;">RETURN</span> aValues<br /> </div>[/code:24wg6gwi]
regards
Uwe <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D -->
|
A solution <Row-adjust> after adding a new Cell-BMP.
|
Hello,i noticed, that after adding a new Cell-bmp bigger than the old row-height,the row-height is not adjusted to the new bmp-size.Is there a method to call, after adding the bmp ?I tested some like adjust and oBrw:nRowheightbut no change. I think there should be a new row-height-calculation inside the xbrowse-class.[img:25s8ht8a]http://www.pflegeplus.com/pictures/xbrw13.jpg[/img:25s8ht8a]regardsUwe <!-- s:lol: --><img src="{SMILIES_PATH}/icon_lol.gif" alt=":lol:" title="Laughing" /><!-- s:lol: -->
|
A solution <Row-adjust> after adding a new Cell-BMP.
|
Hello,I added a few lines in my source to solve the problemof different BMP-Hight and row-adjust.I works fine now.Is it possible to do the adjust-calculation in the xBrowse class ?[img:bxnx8gm0]http://www.pflegeplus.com/pictures/xbrw14.jpg[/img:bxnx8gm0][code:bxnx8gm0]
//------------------- PAINT CELL-BITMAP -----------//
FUNCTION xBNEWF5(oLbx0)
LOCAL oBmp1
oCol := oLbx0:aCols[ 1 ]:AddBmpFile(LOGO2)
oLbx0:aCols[ 1 ]:bBmpData := {|| oLbx0:nArrayAt }
DEFINE BITMAP oBmp1 FILENAME LOGO2
nBMPHight := oBmp1:nHeight()
oBmp1:End()
IF oLbx0:nRowHeight < nBMPHight
oLbx0:nRowHeight := nBMPHight + 4
ENDIF
oLbx0:Refresh()
RETURN( NIL )
[/code:bxnx8gm0]RegardsUwe <!-- s:lol: --><img src="{SMILIES_PATH}/icon_lol.gif" alt=":lol:" title="Laughing" /><!-- s:lol: -->
|
A solution <Row-adjust> after adding a new Cell-BMP.
|
Uwe,We are reviewing the xbrowse version that was going to be published for 8.09.We are going to review the way to implement your request too, thanks <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
|
A solution for BTNBMP using animated GIF's
|
Hello,
is it possible to display a animated GIF inside BTNBMP ?
I can use a TRANSPARENT button and split the animated GIF to it single images
Next using oBtn:SetFile(Frame&No.gif ) inside a loop on buttonclick
but I need up to 20 single images.
Next to perform the ACTION during the GIF is running.
Maybe possible ?
It would be a nice extension of BTNBMP.
For the moment only the 1. image is displayed.
[img:2egfj8rs]http://www.pflegeplus.com/IMAGES/Animat1.jpg[/img:2egfj8rs]
regards
Uwe <!-- s:?: --><img src="{SMILIES_PATH}/icon_question.gif" alt=":?:" title="Question" /><!-- s:?: -->
|
A solution for BTNBMP using animated GIF's
|
I do not understand your needs
But this works for me
[code=fw:jsxgpe2g]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"FiveWin.ch"</span><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"gif.ch"</span><br /><br /><span style="color: #00C800;">function</span> Main<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">local</span> oDlg, oBtn<br /><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"Attention"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">400</span>, <span style="color: #000000;">600</span><br /><br /> @ <span style="color: #000000;">2</span>, <span style="color: #000000;">11</span> BUTTONBMP oBtn <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Waiting to use the calculator"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">120</span>, <span style="color: #000000;">200</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">ACTION</span> <span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">(</span> <span style="color: #ff0000;">"Hello"</span> <span style="color: #000000;">)</span><br /><br /> <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">CENTERED</span> ;<br /> <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">INIT</span> PlaceGif<span style="color: #000000;">(</span> oBtn <span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #00C800;">function</span> PlaceGif<span style="color: #000000;">(</span> oDlg <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">local</span> oGif<br /><br /> @ <span style="color: #000000;">19</span>, <span style="color: #000000;">10</span> GIF oGif FILENAME <span style="color: #ff0000;">"..<span style="color: #000000;">\g</span>ifs<span style="color: #000000;">\g</span>if05.gif"</span> <span style="color: #0000ff;">OF</span> oDlg<br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /> </div>[/code:jsxgpe2g]
|
A solution for BTNBMP using animated GIF's
|
Cristobal,
that is NOT the result, I'm looking for
the problem : the animated GIF is NOT shown transparent and the button-action is disabled
as well NO tooltip and NO prompt is visible !!!
You can download my complete sample, to see what I mean :
( as well You can enable Your solution < PLACEGIF > for a test )
<!-- m --><a class="postlink" href="http://www.pflegeplus.com/DOWNLOADS/Anigif2.zip">http://www.pflegeplus.com/DOWNLOADS/Anigif2.zip</a><!-- m -->
[b:2unagpui]the RESULT using function < PLACEGIF >[/b:2unagpui]
[img:2unagpui]http://www.pflegeplus.com/IMAGES/Animat2.jpg[/img:2unagpui]
my solution :
replacing the button-image calling a gif-paint-function
@ 30, 85 BTNBMP oBtn[7] SIZE 90, 90 OF oDlg 2007 ;
FILENAME c_path1 + "Animat_1.gif" ; // the 1. image of a set. Using a animated gif, only the 1. image is visible
CENTER ROUND ;
PROMPT "&Run .." ;
FONT oTextFont ;
[color=#0000FF:2unagpui][b:2unagpui]ACTION ( RUN_ACTION(oBtn), lRun := .T., GIF_RUN(oBtn) )[/b:2unagpui][/color:2unagpui]
// calling the single images of a defined set. The animated GIF is splitted to the single-images
oBtn[7]:lTransparent := .T.
oBtn[7]:SetColor( 128 )
oBtn[7]:cTooltip := { "RUN" + CRLF + ;
"animated GIF","RUN", 1, CLR_BLACK, 14089979 }
regards
Uwe <!-- s:roll: --><img src="{SMILIES_PATH}/icon_rolleyes.gif" alt=":roll:" title="Rolling Eyes" /><!-- s:roll: -->
|
A solution for BTNBMP using animated GIF's
|
Uwe, your sample run OK, for me
[img:2pwq4y42]https://s32.postimg.org/b5wlk3vph/0061.png[/img:2pwq4y42]
|
A solution for BTNBMP using animated GIF's
|
Uwe, sorry,
Now I understand your problem
I'll investigate
|
A solution for BTNBMP using animated GIF's
|
Cristobal,
I added another set in blue using bmp-format NO alpha < 1.bmp - 18.bmp >
( works as well and can be created as resource )
added a different start and endimage
The solution could be used like in windows shutdown or start ( with button-style NOBORDER )
<!-- m --><a class="postlink" href="http://www.pflegeplus.com/DOWNLOADS/Anigif2.zip">http://www.pflegeplus.com/DOWNLOADS/Anigif2.zip</a><!-- m -->
regards
Uwe <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D -->
|
A solution for BTNBMP using animated GIF's
|
Cristobal . Si interesa tengo algo con gdiplus que funciona con un código muy similar pero sin crear los frames externos ...
el código seria similar a esto . ( faltaría liberar hbitmaps )
el exe funcionando <!-- m --><a class="postlink" href="https://www.dropbox.com/s/srnfuaa84h9rnui/anibtn.exe?dl=0">https://www.dropbox.com/s/srnfuaa84h9rn ... n.exe?dl=0</a><!-- m -->
[code=fw:2isul5pg]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><br /><span style="color: #00C800;">FUNCTION</span> GIF_RUN<span style="color: #000000;">(</span>oBtn<span style="color: #000000;">)</span><br /><span style="color: #00C800;">local</span> hbitmap<br /><span style="color: #00C800;">local</span> hbmpFrame<br /><span style="color: #00C800;">local</span> hbmp<br /><span style="color: #00C800;">LOCAL</span> I := <span style="color: #000000;">1</span> <br /><span style="color: #00C800;">local</span> nLen <br /><br />hbmp:= GDIPLUSIMAGEFFILE<span style="color: #000000;">(</span> c_path1 + <span style="color: #ff0000;">"animat"</span> + <span style="color: #ff0000;">".gif"</span> <span style="color: #000000;">)</span><br /><span style="color: #00C800;">if</span> GDIPLUSISANIMATEDGIF<span style="color: #000000;">(</span> hbmp <span style="color: #000000;">)</span> <br /> nLen:= GDIPLUSIMGGETFRAMECOUNT<span style="color: #000000;">(</span>hbmp<span style="color: #000000;">)</span><br /> <span style="color: #00C800;">DO</span> <span style="color: #00C800;">WHILE</span> lRun = .T.<br /> <span style="color: #00C800;">FOR</span> I := <span style="color: #000000;">1</span> <span style="color: #0000ff;">TO</span> nLen<br /> <span style="color: #00C800;">IF</span> lRun = .F.<br /> EXIT<br /> <span style="color: #00C800;">ENDIF</span><br /> hbmpFrame := GDIPLUSIMGGETFRAME<span style="color: #000000;">(</span>hbmp, i<span style="color: #000000;">)</span><br /> hBitmap:= GdiPlusCreateHBitmapImage<span style="color: #000000;">(</span> hbmpFrame <span style="color: #000000;">)</span><br /> oBtn<span style="color: #000000;">[</span><span style="color: #000000;">7</span><span style="color: #000000;">]</span>:<span style="color: #000000;">LoadBitmaps</span><span style="color: #000000;">(</span> bitmap <span style="color: #000000;">)</span><br /> oBtn<span style="color: #000000;">[</span><span style="color: #000000;">7</span><span style="color: #000000;">]</span>:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> SYSWAIT<span style="color: #000000;">(</span><span style="color: #000000;">0.1</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">NEXT</span><br /> <span style="color: #00C800;">ENDDO</span><br /><span style="color: #00C800;">endif</span><br />oBtn<span style="color: #000000;">[</span><span style="color: #000000;">7</span><span style="color: #000000;">]</span>:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br /><br /> </div>[/code:2isul5pg]
|
A solution for BTNBMP using animated GIF's
|
Manuel, si, eso ya lo había visto, muchas gracias
El problema es que cuando se muestra un GIF ( no las imágenes sucesivamente como ahora ), el GIF no se muestra transparente
Saludos
Manuel, yes, that I had already seen, thank you very much
The problem is that when shown a GIF (not images successively as now), the GIF is not displayed transparent
Regards
|
A solution for BTNBMP using animated GIF's
|
[quote="cnavarro":1n7jlzdz]Manuel, si, eso ya lo había visto, muchas gracias
El problema es que cuando se muestra un GIF ( no las imágenes sucesivamente como ahora ), el GIF no se muestra transparente
Saludos
Manuel, yes, that I had already seen, thank you very much
The problem is that when shown a GIF (not images successively as now), the GIF is not displayed transparent
Regards[/quote:1n7jlzdz]
Cristobal en mis pruebas aqui ....
si uso como imagen
@ 30, 85 BTNBMP oBtn[7] SIZE 90, 90 OF oDlg 2007 ;
FILENAME c_path1 + "Animat_1" + ".gif" ;
la imagen me sale con fondo negro
@ 30, 85 BTNBMP oBtn[7] SIZE 90, 90 OF oDlg 2007 ;
FILENAME c_path1 + "Animat" + ".gif" ;
la imagen sale trasparente .
Si miras la diferencia entre ellas es que ésta ultima su tipo es RGB 8 bits mientras la otra es indexado 8 bits.
Parece que gdiplus no detecta correctamente como trasparente las imagenes indexadas .
|
A solution for BTNBMP using animated GIF's
|
Cristobal,
I added some more tests and all animations are working fine
Some new sets are added and working with resources.
[img:2e6tf490]http://www.pflegeplus.com/IMAGES/Anigif3.jpg[/img:2e6tf490]
[img:2e6tf490]http://www.pflegeplus.com/IMAGES/Anigif4.jpg[/img:2e6tf490]
1 small problem with sample 2 :
A button-animation is running as long < lRun = .T. >
Is there a way as soon closing MS-calc.exe, to set < lRun = .F.> to stop the animation ?
I tested inside the loop with
MsgAlert( [color=#0000FF:2e6tf490][b:2e6tf490]IsExeRunning( "calc.exe" )[/b:2e6tf490][/color:2e6tf490] )
1. lRun starts with .F.
2. after open calc.exe lRun shows .T.
3. closing calc.exe < IsExeRunning( "calc.exe" ) > still shows .T.
[code=fw:2e6tf490]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00C800;">FUNCTION</span> GIF_RUN2<span style="color: #000000;">(</span>oBtn<span style="color: #000000;">)</span><br /><span style="color: #00C800;">LOCAL</span> I := <span style="color: #000000;">1</span> <br /><br /><span style="color: #00C800;">DO</span> <span style="color: #00C800;">WHILE</span> lRun = .T.<br /> MsgAlert<span style="color: #000000;">(</span> IsExeRunning<span style="color: #000000;">(</span> <span style="color: #ff0000;">"calc.exe"</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">IF</span> !IsExeRunning<span style="color: #000000;">(</span> <span style="color: #ff0000;">"calc.exe"</span> <span style="color: #000000;">)</span> <span style="color: #B900B9;">// .F. for animation break</span><br /> lRun := .F.<br /> <span style="color: #00C800;">ENDIF</span><br /> <span style="color: #00C800;">FOR</span> I := <span style="color: #000000;">1</span> <span style="color: #0000ff;">TO</span> <span style="color: #000000;">18</span><br /> <span style="color: #00C800;">IF</span> lRun = .F.<br /> EXIT<br /> <span style="color: #00C800;">ENDIF</span><br /> oBtn<span style="color: #000000;">[</span><span style="color: #000000;">8</span><span style="color: #000000;">]</span>:<span style="color: #000000;">SetFile</span><span style="color: #000000;">(</span> c_path1 + <span style="color: #ff0000;">"A_"</span> + LTRIM<span style="color: #000000;">(</span>STR<span style="color: #000000;">(</span>I<span style="color: #000000;">)</span><span style="color: #000000;">)</span> + <span style="color: #ff0000;">".gif"</span> <span style="color: #000000;">)</span><br /> oBtn<span style="color: #000000;">[</span><span style="color: #000000;">8</span><span style="color: #000000;">]</span>:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> SYSWAIT<span style="color: #000000;">(</span><span style="color: #000000;">0.1</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">NEXT</span><br /><span style="color: #00C800;">ENDDO</span><br />oBtn<span style="color: #000000;">[</span><span style="color: #000000;">8</span><span style="color: #000000;">]</span>:<span style="color: #000000;">SetFile</span><span style="color: #000000;">(</span> c_path1 + <span style="color: #ff0000;">"Calc.bmp"</span> <span style="color: #000000;">)</span><br />oBtn<span style="color: #000000;">[</span><span style="color: #000000;">8</span><span style="color: #000000;">]</span>:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br /> </div>[/code:2e6tf490]
regards
Uwe <!-- s:?: --><img src="{SMILIES_PATH}/icon_question.gif" alt=":?:" title="Question" /><!-- s:?: -->
|
A solution for BTNBMP using animated GIF's
|
I added some more tests
New : sample using a DLL and a sample running a external EXE-file
1. I splitted the anigif to single frames
2. converted the frames to BMP
3. created a DLL
4. added the frames using numeric resource-names
5. calling the resources from inside a FOR / NEXT for the button
[img:33wfq2h5]http://www.pflegeplus.com/IMAGES/Dll2.jpg[/img:33wfq2h5]
[code=fw:33wfq2h5]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #B900B9;">// the DLL includes the frames from < C_1.bmp to C_12.bmp ></span><br /><br /><span style="color: #00C800;">FUNCTION</span> GIF_RUN4<span style="color: #000000;">(</span>cStyle, oBtn<span style="color: #000000;">)</span><br /><span style="color: #00C800;">LOCAL</span> I := <span style="color: #000000;">1</span> <br /><br /><span style="color: #00C800;">DO</span> <span style="color: #00C800;">WHILE</span> lRun = .T.<br /> <span style="color: #00C800;">FOR</span> I := <span style="color: #000000;">1</span> <span style="color: #0000ff;">TO</span> <span style="color: #000000;">12</span><br /> <span style="color: #00C800;">IF</span> lRun = .F.<br /> EXIT<br /> <span style="color: #00C800;">ENDIF</span><br /> oABtn<span style="color: #000000;">[</span><span style="color: #000000;">4</span><span style="color: #000000;">]</span>:<span style="color: #000000;">SetFile</span><span style="color: #000000;">(</span> cStyle + LTRIM<span style="color: #000000;">(</span>STR<span style="color: #000000;">(</span>I<span style="color: #000000;">)</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span> <span style="color: #B900B9;">// resource from DLL</span><br /> oABtn<span style="color: #000000;">[</span><span style="color: #000000;">4</span><span style="color: #000000;">]</span>:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> SYSWAIT<span style="color: #000000;">(</span><span style="color: #000000;">0.1</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">NEXT</span><br /><span style="color: #00C800;">ENDDO</span><br />oABtn<span style="color: #000000;">[</span><span style="color: #000000;">4</span><span style="color: #000000;">]</span>:<span style="color: #000000;">SetFile</span><span style="color: #000000;">(</span> c_path1 + <span style="color: #ff0000;">"Dll.bmp"</span> <span style="color: #000000;">)</span><br />oABtn<span style="color: #000000;">[</span><span style="color: #000000;">4</span><span style="color: #000000;">]</span>:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br /> </div>[/code:33wfq2h5]
regards
Uwe <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D -->
|
A straight FILE-FIND - function ?
|
Hello,i'm busy, to create a new easy to use 3 step - MAKE-utility.1. define a project-name.2. select HARBOUR or xHARBOUR.3. select your project path.thats allI want a automatic find of the installed FWH, xHARBOUR, HARBOUR, BORLAND-files.------ Start of the MAKE-script#Borland make sample, (c) FiveTech Software 2005HBDIR=d:\xharbourBCDIR=d:\bcc55FWDIR=d:\fwh-----------------------------At first i have to scan for drives : aDrives( [<nType>] ) --> aDrives than in a loop of the aDrives-array for the files : aFindFile( <cFileName>, <cPath>, <aResult> ) --> aResult I tested aFindfile() as stand-alone prog., but don't get it workingbound-error and so on.aResult1 := {} // BorlandaResult2 := {} // HarbouraResult3 := {} // FWH// <cFileName> File to search. // <cPath> Path of beginning of the search. // <aResult> Array where the result of the search will be stored. aFindFile( "BCC32.exe", "c:", aResult1 ) // starting from c: msgalert( aResult1[1][1] ) ?????aFindFile( "HARBOUR.exe", "c:", aResult2 ) msgalert( aResult2[1][1] ) ?????aFindFile( "FIVEH.lib", "c:", aResult3 ) msgalert( aResult3[1][1] ) ?????somebody knows, how the structure of the return-array looks ?i couldn't find a sample.is there another way ( maybe a API-function ) to scan for the directory infos ?Best RegardsUwe <!-- s:lol: --><img src="{SMILIES_PATH}/icon_lol.gif" alt=":lol:" title="Laughing" /><!-- s:lol: -->
|
A straight FILE-FIND - function ?
|
Hello Uwe,I sent you my snipkeeper. Please have a look into it.Regards,Otto
|
A straight FILE-FIND - function ?
|
Hi Otto.Could you send me a copy as well?
|
A straight FILE-FIND - function ?
|
Hi allI'm working on a FiveLinux make utility. To this end I have written a FILES class and worked on some shell scripts including providing the date and time of compilation as a define for the xHarbour compiler so you can know exactly when any executable file was compiled. I have shown that I can happily compile and link FiveLinux applications from my FiveLinux utility.DOS/Windows batch files aren't as capable as shell scripts (I think) so a FiveWin version might need the utility to a bit more work in terms of generating a batch file to run or run each step.My current shell script is as follows:[code:1kclito3]#!/bin/bash
# m.sh
builddate=$(date +"%d/%m/%Y@%T")
strBD=""
strBD+='-dkBDATE="'
strBD+=${builddate}
strBD+='"'
echo date string is ${strBD}
if [ $# = 0 ]; then
echo syntax: ./m.sh project
echo where project is the name of the Five Linux project [.flp] file
exit
fi
check_errs()
{
# Parameter 1 is the return code
# Parameter 2 is text to display on failure.
if [ "${1}" -ne "0" ]; then
echo "ERROR # ${1} : ${2}"
exit ${1}
fi
}
compile_prg()
{
# Parameter 1 is the module name
echo compiling $1.prg xHarbour code to C code
./../../xharbour/bin/harbour $1.prg -n -I./../include -I./../../xharbour/include -q0 ${strBD}
check_errs $? "compiling ${1}.prg"
echo compiling $1.c to object code
gcc $1.c -c -I./../include -I./../../xharbour/include `pkg-config --cflags gtk+-2.0`
check_errs $? "compiling ${1}.c"
rm $1.c
}
. ${1}.flp
echo
echo Building ${appname}
echo
objects=""
for m in ${sources}
do
compile_prg ${m}
objects+=" ${m}.o"
done
libs="-lfivex -lfivec -lcommon -lvm -lrtl -lrdd -lmacro -llang -lcodepage -lpp -ldbfntx -ldbfcdx -ldbffpt -lhbsix -lhsx -lpcrepos -lusrrdd -ltip -lct -lcgi -lgtnul -lgtstd -lgtcgi -lgtcrs -lhbodbc -ldebug -lm -lgpm -lncurses"
ldirs="-L./../lib -L./../../xharbour/lib"
cfigs="`pkg-config --libs gtk+-2.0` `pkg-config --libs libglade-2.0` `pkg-config --libs libgnomeprintui-2.2`"
echo linking to create ${output}
gcc ${objects} -o${output} ${ldirs} ${cfigs} -Wl,--start-group ${libs} -Wl,--end-group
echo removing object files
for m in ${sources}
do
rm ${m}.o
done
echo done![/code:1kclito3]
The project (.flp) file is what varies. It is included by the line
[code:1kclito3]. ${1}.flp[/code:1kclito3]
it's name having been passed in as the parameter to the shell script. This file looks like this:
[code:1kclito3]#!/bin/bash
appname="mSYS Medical Software"
output="mSYS"
sources="mSYS
mTEMLIST
xOBJECTS
PATIENT_Class
PATFILE_Class
EXTEND5
DOCTOR_Classes
OSTEO_Class
SINGLE_Class
xPATIENT_Class
PRINTERS
RECORD_Class"[/code:1kclito3]
which can be generated easily by the utility. Please note that the utility isn't finished yet. But the main thing is to perfect the FILES class (I have some issues with UPDATE option on BROWSEs under FiveLinux).
A utility that could also handle both FiveLinux and FiveWin would be nice (ie same source code)
My FILES class as it stands is as follows:
[code:1kclito3]CLASS FILES
DATA sDir /** string: absolute directory name of directory to list */
DATA aDirs /** array: of directory names of above directory */
DATA aFDirInfo /** array: of contents of above directory */
DATA lEntries /** logical: aFDirInfo has real entries rather than just a dummy entry so browse doesn't crash */
DATA brw_FILE_LIST /** object: file list browse object */
DATA bInclude /** code block: evaluated to determine if a file entry should be included */
DATA sSelectedFile /** string: the name of the selected file */
DATA lSelectionMade /** logical: a file has been selected */
METHOD New() CONSTRUCTOR
METHOD GetList( plUpdateDirs )
METHOD Select( psWhat, psFullName )
METHOD ChooseDir( piLevel )
METHOD Select_Clicked()
ENDCLASS
METHOD New() CLASS FILES
::aFDirInfo := ARRAY( 0 )
RETURN self
METHOD GetList( plUpdateDirs ) CLASS FILES
LOCAL sTokenEnv /** string: work variable for tokeniser */
LOCAL iDirDepth /** integer: depth of directory */
LOCAL aDirInfo /** array: of directory contents unsorted and unfiltered */
LOCAL aEntry /** array: used for building ::aFDirInfo entries*/
LOCAL lInclude /** logical: should this entry be included in the filtered list */
IF plUpdateDirs
::aDirs := ARRAY( 0 )
AAdd( ::aDirs, "/" )
::sDir := CurDirX()
TokenInit( @::sDir, "/", 0, @sTokenEnv )
DO WHILE .NOT. TokenEnd( @sTokenEnv )
sToken := TokenNext( @::sDir, , @sTokenEnv )
AAdd( ::aDirs, sToken )
ENDDO
ENDIF
// ? "Length of aDirs", LEN( ::aDirs )
// ? "aDirs[1]", ::aDirs[1]
// ? "aDirs[2]", ::aDirs[2]
aDirInfo := Directory( ::sDir + "*", "d" )
// MsgInfo( "raw entries = " + STR( LEN( aDirInfo ) ) )
// ::aFDirInfo := ARRAY( 0 )
ASize( ::aFDirInfo, 0 )
FOR ii = 1 TO LEN( aDirInfo )
// ? aDirInfo[ii][1], aDirInfo[ii][5]
IF aDirInfo[ii][5] = "D"
aENTRY := ARRAY( 0 )
AADD( aEntry, aDirInfo[ii][1] )
AADD( aEntry, "(dir)" )
AADD( ::aFDirInfo, aEntry )
ELSE
// IF RIGHT( aDirInfo[ii][1], 4 ) = ".flp"
lInclude := Eval( ::bInclude, aDirInfo[ii][1] )
IF lInclude
aENTRY := ARRAY( 0 )
AADD( aEntry, aDirInfo[ii][1] )
AADD( aEntry, "(file)" )
AADD( ::aFDirInfo, aEntry )
ENDIF
ENDIF
NEXT
ASORT( ::aFDirInfo, , , { |x, y| ( x[2] < y[2] ) .OR. ( (x[2] = y[2] ) .AND. ( UPPER( x[1] ) < UPPER( y[1] ) ) ) } )
IF LEN( ::aFDirInfo ) < 1
aENTRY := ARRAY( 0 )
AAdd( aENTRY, "" )
AAdd( aENTRY, "" )
AAdd( ::aFDirInfo, aENTRY )
::lEntries := .F.
ELSE
::lEntries := .T.
ENDIF
RETURN nil
METHOD Select( psWhat, psFullName ) CLASS FILES
LOCAL dlg_SELECT_FILE /** string: file selection dialog */
LOCAL btn_SELECT /** object (button): select button on dlg_SELECT_FILE */
LOCAL sTitle /** string: dialog title */
LOCAL iNextCol /** integer: horizontal position of next directory button */
LOCAL iDirDepth /** integer: number of directory levels */
LOCAL ii /** integer: loop counter */
LOCAL oThisButton /** object (button): store buttons so their properties can be manipulated */
LOCAL sThisLabel /** string: directory name = label for this button */
LOCAL iThisWidth /** integer: calculated required button width */
LOCAL lLoop /** logical: loop controller */
sTitle := "Open " + psWhat
lLoop := .T.
DO WHILE lLoop
DEFINE DIALOG dlg_SELECT_FILE TITLE sTitle SIZE 600, 800
iNextCol := 4
iDirDepth := LEN( ::aDirs )
FOR ii = 1 TO iDirDepth
sThisLabel := ::aDirs[ii]
iThisWidth := ( ( LEN( sThisLabel ) + 2 ) * 8 )
@ 60, iNextCol BUTTON oThisButton PROMPT sThisLabel SIZE iThisWidth, 27 ;
ACTION ( ::ChooseDir( o:cargo ), ::brw_FILE_LIST:SetArray( ::aFDirInfo ), dlg_SELECT_FILE:Refresh() ) OF dlg_SELECT_FILE PIXEL
iNextCol += (iThisWidth + 6 )
oThisButton:cargo := ii
NEXT
@ 9, 0.4 BROWSE ::brw_FILE_LIST ;
FIELDS ::aFDirInfo[::brw_FILE_LIST:nAt][2], ::aFDirInfo[::brw_FILE_LIST:nAt][1] ;
HEADERS "Type", "File Name" SIZE 460, 510 OF dlg_SELECT_FILE
BrwSetColWidths( ::brw_FILE_LIST , { 60, 380 } )
::brw_FILE_LIST:iLength := LEN( ::aFDirInfo )
::brw_FILE_LIST:SetArray( ::aFDirInfo )
::brw_FILE_LIST:bLDblClick := { | nRow, nCol | btn_SELECT:Click() }
@ 700, 10 BUTTON btn_SELECT PROMPT "Select" ;
ACTION ( lLoop := ::Select_Clicked( ::sDir + ::aFDirInfo[::brw_FILE_LIST:nAt][1] ), ;
IF( !lLoop, dlg_SELECT_FILE:End(), dlg_SELECT_FILE:End() ) ) ;
WHEN ::lEntries OF dlg_SELECT_FILE PIXEL UPDATE
// ACTION ( lLoop := ::Select_Clicked( ::sDir + ::aFDirInfo[::brw_FILE_LIST:nAt][1] ), IF( lLoop, dlg_SELECT_FILE:Refresh(), dlg_SELECT_FILE:End() ) ) ;
// ACTION ( ::Select_Clicked( ::sDir + ::aFDirInfo[::brw_FILE_LIST:nAt][1] ), dlg_SELECT_FILE:End() ) ;
@ 700, 110 BUTTON "Cancel" ;
ACTION ( lLoop := .F., dlg_SELECT_FILE:End() ) ;
OF dlg_SELECT_FILE PIXEL
ACTIVATE DIALOG dlg_SELECT_FILE CENTERED
ENDDO
RETURN nil
METHOD ChooseDir( piLevel ) CLASS FILES
LOCAL sDirName
sDirName := "/"
IF piLevel > 1
FOR ii = 2 TO piLevel
sDirName += ::aDirs[ii] + "/"
NEXT
ENDIF
// MsgInfo( sDirName )
::sDir := sDirName
DirChange( ::sDir )
::GetList( .F. )
::brw_FILE_LIST:iLength := LEN( ::aFDirInfo )
::brw_FILE_LIST:SetArray( ::aFDirInfo )
RETURN nil
METHOD Select_Clicked( xProjectFile ) CLASS FILES
IF ::aFDirInfo[::brw_FILE_LIST:nAt][2] = "(dir)"
::sDir += ::aFDirInfo[::brw_FILE_LIST:nAt][1] + "/"
DirChange( ::sDir )
::GetList( .T. )
::brw_FILE_LIST:iLength := LEN( ::aFDirInfo )
::brw_FILE_LIST:SetArray( ::aFDirInfo )
::lSelectionMade := .F.
RETURN .T.
ELSE
::sSelectedFile := xProjectFile
::lSelectionMade := .T.
RETURN .F.
ENDIF [/code:1kclito3]
It wouldn't take much I believe to get it working with FiveWin. I have been playing around with TWBrowse and have added a DATA iLength. You can probably just delete those lines for FiveWin. Plaese note that whilst this code runs it isn't finished or properly documented yet.
With this class opening an (existing) project file is as simple as:
[code:1kclito3]FUNCTION ProjectOpen()
LOCAL oFindProject
oFindProject := FILES():New()
oFindProject:bInclude := { | x | RIGHT( UPPER( x ), 4 ) = ".FLP" }
oFindProject:GetList( .T. )
oFindProject:Select( "Project File" )
RETURN nil[/code:1kclito3]
and compiling it can be done as follows:
[code:1kclito3]FUNCTION Compile( xProject )
LOCAL sOsCommand
sOsCommand := "./m.sh " + xProject + " > " + xProject + ".flb"
RUN ( sOsCommand )
MsgInfo( MemoRead( xProject + ".flb" ) )
RETURN nil[/code:1kclito3]Note that I use the -q0 option so that extra compiler messages (such as line number progress) are suppressed.Maybe some of this is of help? I am happy to contribute if I can help.RegardsDouf(xProgrammer)
|
A strange Error
|
Hi Guys,
I can't use inside FOR/NEXT "REDEFINE GET ...."
It´s a sample of error:
[code=fw:33y16qwf]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">Function</span> Test<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><span style="color: #00C800;">Local</span> oDlg<br /><span style="color: #00C800;">Local</span> aVar := <span style="color: #000000;">{</span><span style="color: #ff0000;">"1"</span>,<span style="color: #ff0000;">"2"</span>,<span style="color: #ff0000;">"3"</span><span style="color: #000000;">}</span><br /><span style="color: #00C800;">Local</span> aGet := Array<span style="color: #000000;">(</span> <span style="color: #000000;">3</span> <span style="color: #000000;">)</span><br /><span style="color: #00C800;">Local</span> nNum<br /><span style="color: #0000ff;">Define</span> <span style="color: #0000ff;">Dialog</span> oDlg<br /><span style="color: #00C800;">For</span> nNum := <span style="color: #000000;">1</span> <span style="color: #0000ff;">To</span> <span style="color: #000000;">3</span><br /> nID := <span style="color: #000000;">4000</span> + nNum <span style="color: #B900B9;">// I´ve IDs(4001,4002,4003) in resource from pelles ( all Gets ).</span><br /> <span style="color: #0000ff;">Redefine</span> <span style="color: #0000ff;">Get</span> aGet<span style="color: #000000;">[</span>nNum<span style="color: #000000;">]</span> <span style="color: #0000ff;">Var</span> aVar<span style="color: #000000;">[</span>nNum<span style="color: #000000;">]</span> <span style="color: #0000ff;">ID</span> nID <span style="color: #0000ff;">Of</span> oDlg<br /><span style="color: #00C800;">Next</span> nNum<br /><span style="color: #0000ff;">Activate</span> <span style="color: #0000ff;">Dialog</span> oDlg<br /><span style="color: #00C800;">Return</span> <span style="color: #00C800;">Nil</span></div>[/code:33y16qwf]
It´s compile, more Var was lost. no display correcty values.
[code=fw:33y16qwf]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">Function</span> Test<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><span style="color: #00C800;">Local</span> oDlg<br /><span style="color: #00C800;">Local</span> aVar := <span style="color: #000000;">{</span><span style="color: #ff0000;">"1"</span>,<span style="color: #ff0000;">"2"</span>,<span style="color: #ff0000;">"3"</span><span style="color: #000000;">}</span><br /><span style="color: #00C800;">Local</span> aGet := Array<span style="color: #000000;">(</span> <span style="color: #000000;">3</span> <span style="color: #000000;">)</span><br /><span style="color: #00C800;">Local</span> nNum<br /><span style="color: #0000ff;">Define</span> <span style="color: #0000ff;">Dialog</span> oDlg<br /><span style="color: #00C800;">For</span> nNum := <span style="color: #000000;">1</span> <span style="color: #0000ff;">To</span> <span style="color: #000000;">2</span><br /> nID := <span style="color: #000000;">4000</span> + nNum <span style="color: #B900B9;">// I´ve IDs(4001,4002,4003) in resource from pelles ( all Gets ).</span><br /> <span style="color: #0000ff;">Redefine</span> <span style="color: #0000ff;">Get</span> aGet<span style="color: #000000;">[</span>nNum<span style="color: #000000;">]</span> <span style="color: #0000ff;">Var</span> aVar<span style="color: #000000;">[</span>nNum<span style="color: #000000;">]</span> <span style="color: #0000ff;">ID</span> nID <span style="color: #0000ff;">Of</span> oDlg <span style="color: #B900B9;">// it´s wrong vars vaues is incorrect.</span><br /><span style="color: #00C800;">Next</span> nNum<br /><span style="color: #0000ff;">Redefine</span> <span style="color: #0000ff;">Get</span> aGet<span style="color: #000000;">[</span><span style="color: #000000;">3</span><span style="color: #000000;">]</span> <span style="color: #0000ff;">Var</span> aVar<span style="color: #000000;">[</span><span style="color: #000000;">3</span><span style="color: #000000;">]</span> <span style="color: #0000ff;">ID</span> <span style="color: #000000;">4003</span> <span style="color: #0000ff;">Of</span> oDlg <span style="color: #B900B9;">// it´s ok</span><br /><span style="color: #0000ff;">Activate</span> <span style="color: #0000ff;">Dialog</span> oDlg<br /><span style="color: #00C800;">Return</span> <span style="color: #00C800;">Nil</span></div>[/code:33y16qwf]
My Solucion was do without use For/Next.
<!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D --> ( confuse,,, logic is correct,,, I´cant understand why... )
|
A strange Error
|
Hello
Try
[code=fw:1kiwfuz5]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"fivewin.ch"</span><br /><br /><span style="color: #00C800;">Function</span> Main<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">Local</span> oDlg<br /> <span style="color: #00C800;">Local</span> aVar := <span style="color: #000000;">{</span><span style="color: #ff0000;">"1"</span>,<span style="color: #ff0000;">"2"</span>,<span style="color: #ff0000;">"3"</span><span style="color: #000000;">}</span><br /> <span style="color: #00C800;">Local</span> aGet := Array<span style="color: #000000;">(</span> <span style="color: #000000;">3</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">Local</span> nNum, uVar := <span style="color: #000000;">1</span><br /> <span style="color: #0000ff;">Define</span> <span style="color: #0000ff;">Dialog</span> oDlg<br /> <span style="color: #00C800;">For</span> nNum := <span style="color: #000000;">1</span> <span style="color: #0000ff;">To</span> <span style="color: #000000;">3</span><br /> @ nNum * <span style="color: #000000;">10</span>, <span style="color: #000000;">10</span> <span style="color: #0000ff;">Get</span> aGet<span style="color: #000000;">[</span>nNum<span style="color: #000000;">]</span> <span style="color: #0000ff;">Var</span> uVar <span style="color: #0000ff;">Of</span> oDlg <span style="color: #0000ff;">pixel</span> <span style="color: #0000ff;">size</span> <span style="color: #000000;">25</span>, <span style="color: #000000;">10</span><br /> aGet<span style="color: #000000;">[</span>nNum<span style="color: #000000;">]</span>:<span style="color: #000000;">bSetGet</span> = BuildSetGet<span style="color: #000000;">(</span> aVar, nNum <span style="color: #000000;">)</span><br /> aGet<span style="color: #000000;">[</span>nNum<span style="color: #000000;">]</span>:<span style="color: #000000;">oGet</span>:<span style="color: #000000;">Block</span> = BuildSetGet<span style="color: #000000;">(</span> aVar, nNum <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">Next</span> nNum<br /> <span style="color: #0000ff;">Activate</span> <span style="color: #0000ff;">Dialog</span> oDlg<br /><span style="color: #00C800;">Return</span> <span style="color: #00C800;">Nil</span><br /><br /><span style="color: #00C800;">function</span> BuildSetGet<span style="color: #000000;">(</span> aVar, n <span style="color: #000000;">)</span><br /><span style="color: #00C800;">return</span> bSETGET<span style="color: #000000;">(</span> aVar<span style="color: #000000;">[</span> n <span style="color: #000000;">]</span> <span style="color: #000000;">)</span></div>[/code:1kiwfuz5]
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.