topic
stringlengths 1
63
| text
stringlengths 1
577k
⌀ |
---|---|
A Forum-error ( PHP ) ?
|
it's very boring to have to enter my login and password all the times I access this forum. Is there any solution? The link I put int the previous post does not help anything?
|
A Forum-error ( PHP ) ?
|
Kleyber,
I have not found a solution for it yet.
I was thinking to install the most recent phpbb in a different folder of the server and
then try to import the entire SQL backup file.
But I guess that all the addons that we have currently installed on our forums, should have
to be ported to the new phpbb version and we may need new versions of them too.
In the meantime, if we could find the right flag to set from phpbb admin panel so we can restore the old and very usefull functionality,
that would be great <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
|
A Forum-error ( PHP ) ?
|
Antonio,
The link I put in the previous post does not show you anything about this problem?
I hope you can find the solution.
|
A Forum-error ( PHP ) ?
|
Kleyber,
We are not using the latest phpBB version as we use several mods (source code with syntax highlighting, etc) that we don't have for the latest phpBB.
so unfortunately that url that you provided me is not of help <!-- s:-( --><img src="{SMILIES_PATH}/icon_sad.gif" alt=":-(" title="Sad" /><!-- s:-( -->
|
A Forum-error ( PHP ) ?
|
I just changed the cookie domain according to this:
[url:2l4n8on7]https://www.phpbb.com/support/docs/en/3.1/kb/article/fixing-incorrect-cookie-settings/[/url:2l4n8on7]
I changed the setting from the attached screenshot to forums.fivetechsupport.com
lets see if that make a difference
old:
[img:2l4n8on7]https://bitbucket.org/fivetech/screenshots/downloads/phpbb_cookie_settings.JPG[/img:2l4n8on7]
new:
[img:2l4n8on7]https://bitbucket.org/fivetech/screenshots/downloads/phpbb_cookie_settings_new.JPG[/img:2l4n8on7]
|
A Forum-error ( PHP ) ?
|
It is still requiring login each time for me, Antonio.
My sympathies for you having to deal with this.
James
|
A Forum-error ( PHP ) ?
|
James,
Yes, I am testing it and noticed that the problem remains there.
Inspecting the cookie with chrome, I just realized a tapatalk error reported by Chrome, so I have emailed tapatalk tech support
as they are very good phpbb experts and hopefully they may help us
|
A Forum-error ( PHP ) ?
|
Dear friends,
I think it is solved!!! <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
Could you please check it and confirm it ?
many thanks!
I had to copy a php.ini and change a value in php.ini in the forums root folder:
request_order = "GPC"
|
A Forum-error ( PHP ) ?
|
Looks fixed for me. <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
EMG
|
A Forum-error ( PHP ) ?
|
+1
|
A Forum-error ( PHP ) ?
|
at first it was even worse for me. It would act like it was logging me in and then go right back to previous not logged in status.
I cleared my History/Cache/Cookies and now I am able to login again.
The world is ok again <!-- s:) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":)" title="Smile" /><!-- s:) -->
Thanks
|
A Forum-error ( PHP ) ?
|
I noticed the same problem
IMPORTANT <!-- s:!: --><img src="{SMILIES_PATH}/icon_exclaim.gif" alt=":!:" title="Exclamation" /><!-- s:!: --> <!-- s:!: --><img src="{SMILIES_PATH}/icon_exclaim.gif" alt=":!:" title="Exclamation" /><!-- s:!: --> <!-- s:!: --><img src="{SMILIES_PATH}/icon_exclaim.gif" alt=":!:" title="Exclamation" /><!-- s:!: -->
[color=#0000FF:20u9yc4x][b:20u9yc4x]clear the History/Cache/Cookies and it is possible to login again.[/b:20u9yc4x][/color:20u9yc4x] <!-- s:!: --><img src="{SMILIES_PATH}/icon_exclaim.gif" alt=":!:" title="Exclamation" /><!-- s:!: -->
it seems to work.
best regards
Uwe <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D -->
|
A Forum-error ( PHP ) ?
|
Perfecto !!!
|
A Forum-error ( PHP ) ?
|
Sometimes I am still not logged in when I return to the site. It seems in the morning I always have to login.
Running windows 8.1 and IE.
James
|
A Forum-error ( PHP ) ?
|
I clear the History/Cache/Cookies on Chrome and Firefox
But each morning at office I must relogin allways
user : Silvio.Falconi
then my account not send the forums advice or the mail I insert not is right ( @eoeo.it)
the <!-- e --><a href="mailto:silvio.falconi@gmail.com">silvio.falconi@gmail.com</a><!-- e --> mail return me the message "The entered e-mail address is already in use"
how I can make to modify the mail ?
|
A Forum-error ( PHP ) ?
|
Silvio,
What email do you want to use ?
|
A Forum-error ( PHP ) ?
|
On Safari with OS X 10.11.3 is perfect.
Thanks a lot.
|
A Forum-error ( PHP ) ?
|
many thanks to all for your great feedback <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
|
A Forum-error ( PHP ) ?
|
<!-- e --><a href="mailto:silvio.falconi@gmail.com">silvio.falconi@gmail.com</a><!-- e -->
|
A Forum-error ( PHP ) ?
|
Silvio,
ok, done
|
A Forum-error ( PHP ) ?
|
great.. all ok !!
|
A Func. to calc. the exact Screen-Pos. of a CircleGradient
|
Hello,
because including the new Circle-Gradient-Function in my Tools,
here is the [color=#FF0000:115hkmmu]exact Calculation [/color:115hkmmu]of the Circle-Position for any Dialog-Size.
I'm working on a [color=#FF0000:115hkmmu]Update[/color:115hkmmu], to include this Calculation in the [color=#FF0000:115hkmmu]SkinTools[/color:115hkmmu].
How it works :
I devided the Screen in 20 Horizontal- and 20 Vertical-parts ( 5 Parts are 1 Screen-Quarter ).
Using Values of 10, 10 centeres the Circle.
Direction Left = minus ( Values 1-9 ), Right = plus ( Values 11-20 )
Up = minus ( Values 1-9 ), Down = plus ( Values 11-20 ).
[img:115hkmmu]http://www.pflegeplus.com/pictures/circlecalc.jpg[/img:115hkmmu]
The Function :
[code=fw:115hkmmu]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #B900B9;">//------------- DLG CIRCLE -----------</span><br /><br /><span style="color: #B900B9;">// How to use it :</span><br /><span style="color: #B900B9;">// Step 1-9 for up and left, 11 - 20 for right and down. 10 = Centered</span><br /><span style="color: #B900B9;">// ------------------------------------------------------------------------------------</span><br /><span style="color: #B900B9;">// 1. Sample : Circle centered</span><br /><span style="color: #B900B9;">// ------------------------------------</span><br /><span style="color: #B900B9;">// ACTIVATE DIALOG oDlg CENTERED ;</span><br /><span style="color: #B900B9;">// ON PAINT ( DLG_CIRCL( oDlg, COLOR1, COLOR2, 10, 10 ) </span><br /><span style="color: #B900B9;">//</span><br /><span style="color: #B900B9;">// 2. Sample : Circle on left / upper</span><br /><span style="color: #B900B9;">// -------------------------------------------</span><br /><span style="color: #B900B9;">// ACTIVATE DIALOG oDlg CENTERED ;</span><br /><span style="color: #B900B9;">// ON PAINT ( DLG_CIRCL( oDlg, COLOR1, COLOR2, 5, 5 ) </span><br /><span style="color: #B900B9;">//</span><br /><span style="color: #B900B9;">// -------------------------------------------------------------------------------</span><br /><span style="color: #B900B9;">// 3. Sample : Circle on right / bottom </span><br /><span style="color: #B900B9;">// --------------------------------------------------</span><br /><span style="color: #B900B9;">// ACTIVATE DIALOG oDlg CENTERED ;</span><br /><span style="color: #B900B9;">// ON PAINT ( DLG_CIRCL( oDlg, COLOR1, COLOR2, 20, 20 ) </span><br /><span style="color: #B900B9;">// -------------------------------------------------------------------------------</span><br /><span style="color: #B900B9;">//</span><br /><span style="color: #B900B9;">// hDC</span><br /><span style="color: #B900B9;">// { nTop, nLeft, nBottom, nRight },</span><br /><span style="color: #B900B9;">// startColor, endColor</span><br /><span style="color: #B900B9;">// nOffserX, nOffserY</span><br /><span style="color: #B900B9;">// lBrush --> hBitmap / hBrush ( GDI OBJECT )</span><br /><br /><span style="color: #00C800;">FUNCTION</span> DLG_CIRCL<span style="color: #000000;">(</span> oDlg, nVColor, nBColor, W_Hoffset, W_Voffset <span style="color: #000000;">)</span> <br /><span style="color: #00C800;">LOCAL</span> oBrushBmp := TBrush<span style="color: #000000;">(</span><span style="color: #000000;">)</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><span style="color: #00C800;">LOCAL</span> hDC := oDlg:<span style="color: #000000;">GETDC</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><span style="color: #00C800;">LOCAL</span> aRect := GETCLIENTRECT<span style="color: #000000;">(</span> oDlg:<span style="color: #000000;">hWnd</span> <span style="color: #000000;">)</span><br /><span style="color: #00C800;">LOCAL</span> nXa := aRect<span style="color: #000000;">[</span><span style="color: #000000;">3</span><span style="color: #000000;">]</span> / <span style="color: #000000;">20</span>, nYa := aRect<span style="color: #000000;">[</span><span style="color: #000000;">4</span><span style="color: #000000;">]</span> / <span style="color: #000000;">20</span><br /><span style="color: #00C800;">LOCAL</span> nX := <span style="color: #000000;">0</span>, nY := <span style="color: #000000;">0</span> <span style="color: #B900B9;">// Value 10</span><br /><br /><span style="color: #00C800;">IF</span> W_HOFFSET > <span style="color: #000000;">10</span><br /> <span style="color: #B900B9;">// position : right from center dialog to middle Circle</span><br /> nX := W_HOFFSET * nXa<br /><span style="color: #00C800;">ENDIF</span><br /><span style="color: #00C800;">IF</span> W_HOFFSET < <span style="color: #000000;">10</span><br /> <span style="color: #B900B9;">// position : left from center dialog to middle Circle</span><br /> nX := - <span style="color: #000000;">(</span> <span style="color: #000000;">(</span> <span style="color: #000000;">10</span> - W_HOFFSET <span style="color: #000000;">)</span> * nXa <span style="color: #000000;">)</span> <br /><span style="color: #00C800;">ENDIF</span><br /><span style="color: #00C800;">IF</span> W_VOFFSET > <span style="color: #000000;">10</span><br /> <span style="color: #B900B9;">// position : down from center Dialog to middle Circle</span><br /> nY := <span style="color: #000000;">(</span> W_VOFFSET - <span style="color: #000000;">10</span> <span style="color: #000000;">)</span> * nYa <br /><span style="color: #00C800;">ENDIF</span><br /><span style="color: #00C800;">IF</span> W_VOFFSET < <span style="color: #000000;">10</span><br /> <span style="color: #B900B9;">// position : up from middle dialog to middle Circle</span><br /> nY := - <span style="color: #000000;">(</span> <span style="color: #000000;">(</span> <span style="color: #000000;">10</span> - W_VOFFSET <span style="color: #000000;">)</span> * nYa <span style="color: #000000;">)</span> <br /><span style="color: #00C800;">ENDIF</span><br /><br />DeleteObject<span style="color: #000000;">(</span> oBrushBmp:<span style="color: #000000;">hBrush</span> <span style="color: #000000;">)</span><br />oBrushBmp:<span style="color: #000000;">hBrush</span> = CircleGradient<span style="color: #000000;">(</span> <span style="color: #000000;">0</span>, <span style="color: #000000;">{</span> <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> <span style="color: #000000;">}</span> , ;<br />nVColor, nBColor, nX, nY, <span style="color: #000000;">3</span> <span style="color: #000000;">)</span> <br /><br />FillRect<span style="color: #000000;">(</span> hDC, aRect, oBrushBMP:<span style="color: #000000;">hBrush</span> <span style="color: #000000;">)</span><br /><br />oDlg:<span style="color: #000000;">ReleaseDC</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><span style="color: #0000ff;">RELEASE</span> <span style="color: #0000ff;">BRUSH</span> oBrushBMP<br /><br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br /> </div>[/code:115hkmmu]
The new Function will be included in the next SkinTool-Update :
[img:115hkmmu]http://www.pflegeplus.com/pictures/circlecalc1.jpg[/img:115hkmmu]
Best Regards
Uwe <!-- s:lol: --><img src="{SMILIES_PATH}/icon_lol.gif" alt=":lol:" title="Laughing" /><!-- s:lol: -->
|
A G5 brought back to life :-)
|
[url:u50yn5zn]https://discussions.apple.com/message/18267204?ac_cid=142432#18267204[/url:u50yn5zn]
[img:u50yn5zn]http://img716.imageshack.us/img716/4500/lafotobn.jpg[/img:u50yn5zn]
[img:u50yn5zn]http://img163.imageshack.us/img163/2961/picture1un.png[/img:u50yn5zn]
|
A G5 brought back to life :-)
|
Buen aparato ,y baratillo <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) --> , tu reparación me recordó el método para reparar las placas de video metiendolas en el horno a 200ºC
[url:3bx3y8p0]http://www.faq-mac.com/tutoriales/cocinar-para-revivir-literalmente-gf-8800-gt-mac-pro/47732[/url:3bx3y8p0]
Saludos.
|
A G5 brought back to life :-)
|
Manuel,
Si, esa es la idea que tenía en mente pero pensé que aplicarle un calor similar con la pistola de calor seria menos agresivo que meter toda la placa en el horno y uno se ahorra el desmontar todo el ordenador <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
De momento sigue funcionando <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
|
A Harbour view :-)
|
<!-- m --><a class="postlink" href="http://img244.imageshack.us/img244/4475/picture2yw8.png">http://img244.imageshack.us/img244/4475/picture2yw8.png</a><!-- m -->
<!-- m --><a class="postlink" href="http://img225.imageshack.us/img225/7594/picture4rp2.png">http://img225.imageshack.us/img225/7594/picture4rp2.png</a><!-- m -->
|
A Harbour view :-)
|
Antonio,
xHarbour and FiveWin on Apple Mac : it looks very good.
And of course it opens new markets for us, developers.
Many congratulations.
Michel
|
A METRO image-background without FREEIMAGE ?
|
Hello,
for windows without FREEIMAGE I use
// window without FREEIMAGE
[color=#0000FF:118aw3qo]aImage := oWnd:ReadImage( cImage, , .t. )
oWnd:DrawImage( aImage, aRect, nil, 1 )[/color:118aw3qo]
it doesn't work for a METRO-image-background
[color=#0000FF:118aw3qo]DEFINE METROPANEL oMetro OF oWnd TITLE "Stammdaten" ;
COLOR aVal[8], CLR_BLUE
aRect := GETCLIENTRECT( oMetro:hWnd )
aImage := oMetro:ReadImage( cImage, , .t. )
oMetro:DrawImage( aImage, aRect, nil, 1 )[/color:118aw3qo]
a working solution
// metro image-background ( FREEIMAGE needed )
[color=#0000FF:118aw3qo]DEFINE IMAGE oImage FILENAME cImage
oBrush := TBrush():new( ,,,, ResizeBmp( oImage:hBitmap, aRect[4], aRect[3], .T. ) ) // 1 = stretch, 2 : fitoutside, 3:fitinside
oImage:End()
oMetro:SetBrush( oBrush )
RELEASE BRUSH oBrush [/color:118aw3qo]
is it possible to define a metro-image-background without using FREEIMAGE ?
regards
Uwe <!-- s:?: --><img src="{SMILIES_PATH}/icon_question.gif" alt=":?:" title="Question" /><!-- s:?: -->
|
A METRO image-background without FREEIMAGE ?
|
Uwe, try with this
[code=fw:21as32yv]<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;">"metropnl.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> oWnd<br /><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">WINDOW</span> oWnd <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"MetroPanel"</span><br /><br /><br /> Metro<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">WINDOW</span> oWnd <span style="color: #0000ff;">MAXIMIZED</span> <span style="color: #B900B9;">//ON INIT Metro( oWnd )</span><br /><br /><span style="color: #00C800;">Return</span> <span style="color: #00C800;">nil</span><br /><br /><br /><span style="color: #00C800;">Function</span> Metro<span style="color: #000000;">(</span> oWnd <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">local</span> oMetro<br /> <span style="color: #0000ff;">DEFINE</span> METROPANEL oMetro <span style="color: #0000ff;">OF</span> oWnd <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"Stammdaten"</span> <span style="color: #0000ff;">COLOR</span> CLR_WHITE, CLR_BLUE<br /> oMetro:<span style="color: #000000;">bPainted</span> := <span style="color: #000000;">{</span> || oMetro:<span style="color: #000000;">DrawImage</span><span style="color: #000000;">(</span> <span style="color: #ff0000;">"D:<span style="color: #000000;">\F</span>wh<span style="color: #000000;">\F</span>whTeam<span style="color: #000000;">\b</span>itmaps<span style="color: #000000;">\h</span>ires<span style="color: #000000;">\e</span>arth.bmp"</span>, , <span style="color: #00C800;">nil</span>, <span style="color: #000000;">1</span> <span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /> oMetro:<span style="color: #000000;">Show</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">Return</span> oMetro<br /><br /> </div>[/code:21as32yv]
|
A METRO image-background without FREEIMAGE ?
|
Christobal,
thank You that works.
I added the image-background-painting to the defined brushed title-text-section
[color=#0000FF:28bn04ts]// on top
DEFINE FONT oFontLarge NAME "Arial" SIZE 0, -60 BOLD ITALIC
aPalBmp := oWnd:ReadImage( c_Pfad1 + "Marble.bmp", nil, .t. )
pBrush := GDIP_IMAGEBRUSH( aPalBmp[ 1 ] )
--
--
oMetro:Show()
oMetro:bPainted := {|| oMetro:DrawImage( c_Pfad1 + "Sea.jpg", , nil, 1 ), ;
oMetro:SayText( "Stammdaten", { 30, 150, 120, 650 }, "L", oFontLarge, pBrush ) }[/color:28bn04ts]
[img:28bn04ts]http://www.pflegeplus.com/IMAGES/Metro15.jpg[/img:28bn04ts]
regards
Uwe <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D -->
|
A METRO image-background without FREEIMAGE ?
|
The following should be added to metropnel.ch:
#xcommand ACTIVATE METROPANEL <oMtr> => <oMtr>:Show()
or something similar
|
A METRO image-background without FREEIMAGE ?
|
[quote="ukoenig":3jjgi06w]Hello,
for windows without FREEIMAGE I use
// window without FREEIMAGE
[color=#0000FF:3jjgi06w]aImage := oWnd:ReadImage( cImage, , .t. )
oWnd:DrawImage( aImage, aRect, nil, 1 )[/color:3jjgi06w]
it doesn't work for a METRO-image-background
[color=#0000FF:3jjgi06w]DEFINE METROPANEL oMetro OF oWnd TITLE "Stammdaten" ;
COLOR aVal[8], CLR_BLUE
aRect := GETCLIENTRECT( oMetro:hWnd )
aImage := oMetro:ReadImage( cImage, , .t. )
oMetro:DrawImage( aImage, aRect, nil, 1 )[/color:3jjgi06w]
a working solution
// metro image-background ( FREEIMAGE needed )
[color=#0000FF:3jjgi06w]DEFINE IMAGE oImage FILENAME cImage
oBrush := TBrush():new( ,,,, ResizeBmp( oImage:hBitmap, aRect[4], aRect[3], .T. ) ) // 1 = stretch, 2 : fitoutside, 3:fitinside
oImage:End()
oMetro:SetBrush( oBrush )
RELEASE BRUSH oBrush [/color:3jjgi06w]
is it possible to define a metro-image-background without using FREEIMAGE ?
regards
Uwe <!-- s:?: --><img src="{SMILIES_PATH}/icon_question.gif" alt=":?:" title="Question" /><!-- s:?: -->[/quote:3jjgi06w]
Except the TImage() class, no other class requires freeimage.dll.
Your approach to create the resizable brush is round about.
You will get the correct results if you keep you code simple.
Use this one line code, which does everything for you
[code=fw:3jjgi06w]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BRUSH</span> oBrush FILE <anyimagesource> RESIZE <br /> </div>[/code:3jjgi06w]
Use RESIZE clause while creating the brush. This will automatically resize to fit the window (or panel).
It will keep resizing when the window is resized.
Avoid doing resize yourself in your application program
[code=fw:3jjgi06w]<div class="fw" id="{CB}" style="font-family: monospace;"><br />oMetro:<span style="color: #000000;">SetBrush</span><span style="color: #000000;">(</span> oBrush <span style="color: #000000;">)</span><br /> </div>[/code:3jjgi06w]
While creating brush, you can use any image source, viz bmp,jpg,png,tiff, etc file on the disk, or resource, or from memory or from the web
Freeimage.dll is not required.
|
A METRO image-background without FREEIMAGE ?
|
Thank You very much,
it works fine with the changes.
regards
Uwe <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D -->
|
A MYSQL4 Forum Problem ?
|
Hello,
a problem to open / write any posts ?
Last year I noticed it as well.
After a while it works again.
[img:125ydqao]http://www.pflegeplus.com/pictures/ForumP1.jpg[/img:125ydqao]
Best Regards
Uwe <!-- s:?: --><img src="{SMILIES_PATH}/icon_question.gif" alt=":?:" title="Question" /><!-- s:?: -->
|
A MYSQL4 Forum Problem ?
|
Doe that mean so many users were accessing the fivetech site at that time.
|
A Painter using the new Circle-Gradient ( FWH 9.09 )
|
Hello,
this Week, a new Update of the Skintools is finished.
There You will find a new Folder-page for Circle-Gradient-Painting :
The new Page :
[img:2m8k0h0h]http://www.pflegeplus.com/pictures/Skin1.jpg[/img:2m8k0h0h]
The Source for it :
[img:2m8k0h0h]http://www.pflegeplus.com/pictures/Skin2.jpg[/img:2m8k0h0h]
The new Button-Preview :
[img:2m8k0h0h]http://www.pflegeplus.com/pictures/Skin3.jpg[/img:2m8k0h0h]
Best Regards
Uwe <!-- s:lol: --><img src="{SMILIES_PATH}/icon_lol.gif" alt=":lol:" title="Laughing" /><!-- s:lol: -->
|
A Possible Action on Headline of Class TSelex ?
|
Hello,
a useful Option would be, adding a [color=#FF0000:1l6xpsm2]ACTION[/color:1l6xpsm2] to the TSelex-headline.
Could be a Help-info or a global Action ( like a extra Prompt ).
[img:1l6xpsm2]http://www.pflegeplus.com/pictures/tselex5.jpg[/img:1l6xpsm2]
Best Regards
Uwe <!-- s:?: --><img src="{SMILIES_PATH}/icon_question.gif" alt=":?:" title="Question" /><!-- s:?: -->
|
A Possible Extension in Class VTitle FWH 9.07 ?
|
Hello,
today I started with FWH 9.07.
I tested the Vtitle-Class.
Is it possible, to add Radio and Checkbox as well like Say and Buttons ?
It works without problems, but I couldn't get it transparent.
Using oTitle:lTransparent := .T., the Title is transparent.
Radio and Checkbox is transparent, but with the Dialog-Gradient.
The Radio and Checkbox belongs to the Dialog. I think, it doesn't work this way,
to get the Gradient-Color from the Title.
[img:1i1b408u]http://www.pflegeplus.com/pictures/Vtitle2.jpg[/img:1i1b408u]
[code=fw:1i1b408u]<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;">"ttitle.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, oTitle, oChk, oRadio<br /><br />lChk := .F.<br />nValue := <span style="color: #000000;">1</span><br /><br />aDLG := <span style="color: #000000;">{</span> <span style="color: #000000;">{</span> <span style="color: #000000;">0.60</span>, <span style="color: #000000;">16752190</span>, <span style="color: #000000;">16777215</span> <span style="color: #000000;">}</span>, ; <br /> <span style="color: #000000;">{</span> <span style="color: #000000;">0.60</span>, <span style="color: #000000;">16777215</span>, <span style="color: #000000;">16752190</span> <span style="color: #000000;">}</span> <span style="color: #000000;">}</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;">5</span> <span style="color: #0000ff;">TO</span> <span style="color: #000000;">30</span>, <span style="color: #000000;">80</span> <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"A Dialog Box"</span><br /><br />@ <span style="color: #000000;">30</span>, <span style="color: #000000;">15</span> <span style="color: #0000ff;">TITLE</span> oTitle <span style="color: #0000ff;">size</span> <span style="color: #000000;">250</span>, <span style="color: #000000;">100</span> <span style="color: #0000ff;">of</span> oDlg SHADOW BOTTOMLEFT SHADOWSIZE <span style="color: #000000;">2</span><br />oTitle:<span style="color: #000000;">aGrdBack</span> := <span style="color: #000000;">{</span> <span style="color: #000000;">{</span> <span style="color: #000000;">1</span>, <span style="color: #000000;">8553215</span>, <span style="color: #000000;">16777215</span> <span style="color: #000000;">}</span> <span style="color: #000000;">}</span><br /><span style="color: #B900B9;">// Transparent Title</span><br />* oTitle:<span style="color: #000000;">lTransparent</span> := .T.<br /><br />@ <span style="color: #000000;">4.2</span>, <span style="color: #000000;">10</span> <span style="color: #0000ff;">CHECKBOX</span> oChk <span style="color: #0000ff;">VAR</span> lChk <span style="color: #0000ff;">OF</span> oDlg <br />oChk:<span style="color: #000000;">lTransparent</span> := .T.<br /><br />@ <span style="color: #000000;">3.5</span>, <span style="color: #000000;">20</span> <span style="color: #0000ff;">RADIO</span> oRadio <span style="color: #0000ff;">VAR</span> nValue <span style="color: #0000ff;">OF</span> oDlg ;<br /><span style="color: #0000ff;">ITEMS</span> <span style="color: #ff0000;">"&One"</span>, <span style="color: #ff0000;">"&Two"</span>, <span style="color: #ff0000;">"T&hree"</span> _3D <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">100</span>, <span style="color: #000000;">16</span> ;<br />HELPID <span style="color: #000000;">100</span>, <span style="color: #000000;">101</span>, <span style="color: #000000;">102</span> ;<br /><span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">CHANGE</span> MsgBeep<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <br /><br />oTitle:<span style="color: #000000;">nShadowIntensity</span> = <span style="color: #000000;">70</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> DLG_GRAD<span style="color: #000000;">(</span> oDlg, .T. <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;">// ------------- DIALOG-GRADIENT -------</span><br /><br /><span style="color: #00C800;">FUNCTION</span> DLG_GRAD<span style="color: #000000;">(</span> oDlg, lDir<span style="color: #000000;">)</span><br /><span style="color: #00C800;">local</span> hDC, hBmp, hBmpOld, nWidth, nHeight, oBrush<br /><br /><span style="color: #00C800;">IF</span> Empty<span style="color: #000000;">(</span> oDlg:<span style="color: #000000;">oBrush</span>:<span style="color: #000000;">hBitmap</span> <span style="color: #000000;">)</span><br /> nHeight := <span style="color: #00C800;">if</span><span style="color: #000000;">(</span>lDir,oDlg:<span style="color: #000000;">nHeight</span>,<span style="color: #000000;">1</span><span style="color: #000000;">)</span><br /> nWidth := <span style="color: #00C800;">if</span><span style="color: #000000;">(</span>lDir,<span style="color: #000000;">1</span>,oDlg:<span style="color: #000000;">nWidth</span><span style="color: #000000;">)</span><br /> hDC = CreateCompatibleDC<span style="color: #000000;">(</span> oDlg:<span style="color: #000000;">GetDC</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> hBmp = CreateCompatibleBitMap<span style="color: #000000;">(</span> oDlg:<span style="color: #000000;">hDC</span>, nWidth, nHeight <span style="color: #000000;">)</span><br /> hBmpOld = SelectObject<span style="color: #000000;">(</span> hDC, hBmp <span style="color: #000000;">)</span><br /> GradientFill<span style="color: #000000;">(</span> hDC, <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span>, nHeight, nWidth, aDLG, lDir <span style="color: #000000;">)</span><br /> DeleteObject<span style="color: #000000;">(</span> oDlg:<span style="color: #000000;">oBrush</span>:<span style="color: #000000;">hBrush</span> <span style="color: #000000;">)</span><br /> oDlg:<span style="color: #000000;">oBrush</span>:<span style="color: #000000;">hBitmap</span> = hBmp<br /> oDlg:<span style="color: #000000;">oBrush</span>:<span style="color: #000000;">hBrush</span> = CreatePatternBrush<span style="color: #000000;">(</span> hBmp <span style="color: #000000;">)</span><br /> SelectObject<span style="color: #000000;">(</span> hDC, hBmpOld <span style="color: #000000;">)</span><br /> oDlg:<span style="color: #000000;">ReleaseDC</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><span style="color: #00C800;">ENDIF</span><br /><br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br /> </div>[/code:1i1b408u]
Best Regards
Uwe : <!-- s:?: --><img src="{SMILIES_PATH}/icon_question.gif" alt=":?:" title="Question" /><!-- s:?: -->
|
A Possible Extension in Class VTitle FWH 9.07 ?
|
Uwe,
You have defined the controls with the "OF oDlg" clause thus they are inheriting from oDlg. I think you meant to use "OF oTitle."
James
|
A Possible Extension in Class VTitle FWH 9.07 ?
|
James,
with Title it doesn't work, because Radios and Checkboxes are unknown :
@ 4.2, 10 CHECKBOX oChk VAR lChk OF [color=#FF0000:1dy350lw]oTitle[/color:1dy350lw] // oDlg
Error description: Warning BASE/1004 Message not found: TTITLE:DEFCONTROL
Args:
Stack Calls
===========
Called from: source\rtl\tobject.prg => TTITLE:ERROR(172)
Called from: source\rtl\tobject.prg => TTITLE:MSGNOTFOUND(205)
Called from: source\rtl\tobject.prg => TTITLE:DEFCONTROL(0)
Called from: .\source\classes\CHECKBOX.PRG => TCHECKBOX:NEW(133)
Called from: testtitl.prg => START_DLG(55)
Called from: testtitl.prg => (b)MAIN(25)
Called from: .\source\classes\WINDOW.PRG => TWINDOW:ACTIVATE(945)
Called from: testtitl.prg => MAIN(25)
Another way :
----------------
nMainStyle = nOR( WS_OVERLAPPED | WS_VISIBLE )
DEFINE DIALOG oDlg FROM 15, 15 TO 250, 500 OF oWnd STYLE nMainStyle PIXEL TRANSPARENT
@ 0, 0 TITLE oTitle size 242, 115 of oDlg SHADOW BOTTOMLEFT SHADOWSIZE 2
[color=#FF0000:1dy350lw]oTitle:lTransparent := .T.[/color:1dy350lw]
@ 4.2, 10 CHECKBOX oChk VAR lChk OF [color=#FF0000:1dy350lw]oDlg[/color:1dy350lw]
oChk:lTransparent := .T.
-----------------------------
A Title on Top of a Dialog with the Title-Size ( just a empty Dialog-Frame ).
The Gradient is defined for the Dialog, the Title is transparent.
But to do it this way, You will loose the round Corners of the Title.
[img:1dy350lw]http://www.pflegeplus.com/pictures/vtitle4.jpg[/img:1dy350lw]
Best Regards
Uwe <!-- s:lol: --><img src="{SMILIES_PATH}/icon_lol.gif" alt=":lol:" title="Laughing" /><!-- s:lol: -->
|
A Possible Extension in Class VTitle FWH 9.07 ?
|
Ewe,
>Error description: Warning BASE/1004 Message not found: TTITLE:DEFCONTROL
I have not looked at the TTitle class yet, but it seems it was not designed to contain controls.
James
|
A Preview and Question for the new ButtonTools
|
Hello,
I finished the Basics on the new ButtonTools and is it a first Overview of the Results.
What we can do :
1. Select any Backgrounds : Color, Gradient, Style-Brush, Image-Brush and Image in Relation to the Buttons.
2. Select a Button-Image and set 2 other Buttons in combination with Text TOP, BOTTOM, LEFT and RIGHT.
3. One Click-Preview shows Buttons from Source or Resource with and without Border and 2007-Style.
4. A Activate-Button for each Dialog-Preview. A Close-all-Button, to close all open Dialogs ( Previews ).
5. Define the Button-Size for the Preview
6. Write the Source for the Button-selections.
7. A Gradient-Designer and Button-Resizer in the Setup-Section.
8. Button-Sets can be stored to a Database and Reloaded.
9. Display of Alpha-Blended-BMP's on Dialog-Bottom ( free Selection of the Image in the Setup-Section ).
10. Transparent Text with defined Font, Color and Size ( is shown together with the Alpha-Blended BMP )
+ some more functions.
Because it is possible now, to do a Preview with all possible Combinations,
a Test shows, that Buttons are not displayed with Borders, using Resources.
With Style 2007 and from Source, the Borders are shown.
On a Dialog Preview, the upper 3 Buttons are shown without Border.
The second Line ( 3 Buttons ) must have Borders.
[img:29hxqcar]http://www.pflegeplus.com/pictures/btntools1.jpg[/img:29hxqcar]
[img:29hxqcar]http://www.pflegeplus.com/pictures/btntools2.jpg[/img:29hxqcar]
Missing Button-Border with Style-Brush and Resources
[img:29hxqcar]http://www.pflegeplus.com/pictures/btntools5.jpg[/img:29hxqcar]
Problem transparent Buttons on Images ?. Style 2007 works.
[img:29hxqcar]http://www.pflegeplus.com/pictures/btntools3.jpg[/img:29hxqcar]
The same with Gradient-Background :
[img:29hxqcar]http://www.pflegeplus.com/pictures/btntools4.jpg[/img:29hxqcar]
-----------------------------------------------------------------------
DEFINE DIALOG oDlg3 RESOURCE "DIALOG1" of oWnd ;
TITLE "Buttons from Resource Transparent" TRANSPARENT
// ----- Transparent Button NOBORDER ---------
[color=#FF0000:29hxqcar]Not Transparent[/color:29hxqcar]
REDEFINE BTNBMP oBtn1 ID 100 OF oDlg3 ;
NOBORDER ;
FILENAME cBUTTON1 ;
ACTION MsgAlert( "Button-Click", "Button 1" ) ;
PROMPT "But.1" ;
FONT oFont1 ;
RIGHT
oBtn1:lTransparent = .t.
oBtn1:cTooltip := "Button1"
[color=#FF0000:29hxqcar]Not Transparent on Images.[/color:29hxqcar]
Colors, Gradient, Styles and Image-Brush is OK.
REDEFINE SAY oSay3 PROMPT "Alpha-Blended BMP" ID 230 OF oDlg3 FONT oFont2
oSay3:lTransparent = .t.
-----------------------------------------------------------
The Dialog-Resource :
[code=fw:29hxqcar]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #B900B9;">//------------------- RESOURCE - TEST 1 -----------------------------------------</span><br /><br /><span style="color: #00C800;">FUNCTION</span> DLG_RES1<span style="color: #000000;">(</span> oWnd,oFont1, oFont2 <span style="color: #000000;">)</span><br /><span style="color: #00C800;">local</span> oBtn1, oBtn2, oBtn3, oBtn4, oBtn5, oBtn6, oBtn7, oSay3<br /><br /><span style="color: #00C800;">IF</span> lOPEN<span style="color: #000000;">[</span><span style="color: #000000;">3</span><span style="color: #000000;">]</span> = .T.<br /> MsgAlert<span style="color: #000000;">(</span> <span style="color: #ff0000;">"Test allready activated !"</span>, <span style="color: #ff0000;">"Attention"</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">RETURN</span><span style="color: #000000;">(</span> <span style="color: #00C800;">NIL</span> <span style="color: #000000;">)</span><br /><span style="color: #00C800;">ENDIF</span><br />lOPEN<span style="color: #000000;">[</span><span style="color: #000000;">3</span><span style="color: #000000;">]</span> := .T.<br /><br /><span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg3 <span style="color: #0000ff;">RESOURCE</span> <span style="color: #ff0000;">"DIALOG1"</span> <span style="color: #0000ff;">of</span> oWnd ;<br /><span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"Buttons from Resource Transparent"</span> TRANSPARENT<br /><br /><span style="color: #B900B9;">// Color</span><br /><span style="color: #B900B9;">// -------</span><br /><span style="color: #00C800;">IF</span> nSTYLE = <span style="color: #000000;">1</span><br /> D_COLOR<span style="color: #000000;">(</span> oDlg3 <span style="color: #000000;">)</span> <br /><span style="color: #00C800;">ENDIF</span><br /><br /><span style="color: #B900B9;">// Style-Brush</span><br /><span style="color: #B900B9;">// ----------------</span><br /><span style="color: #00C800;">IF</span> nSTYLE = <span style="color: #000000;">3</span><br /> D_BRUSH<span style="color: #000000;">(</span> oDlg3 <span style="color: #000000;">)</span> <br /><span style="color: #00C800;">ENDIF</span><br /><br /><span style="color: #B900B9;">// ImageBrush</span><br /><span style="color: #B900B9;">// ----------------</span><br /><span style="color: #00C800;">IF</span> nSTYLE = <span style="color: #000000;">4</span><br /> DB_IMAGE<span style="color: #000000;">(</span> oDlg3 <span style="color: #000000;">)</span> <br /><span style="color: #00C800;">ENDIF</span><br /><br /><span style="color: #B900B9;">// ----- Transparent Buttons with NOBORDER ---------</span><br /><br /><span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">BTNBMP</span> oBtn1 <span style="color: #0000ff;">ID</span> <span style="color: #000000;">100</span> <span style="color: #0000ff;">OF</span> oDlg3 ;<br />NOBORDER ;<br />FILENAME cBUTTON1 ;<br /><span style="color: #0000ff;">ACTION</span> MsgAlert<span style="color: #000000;">(</span> <span style="color: #ff0000;">"Button-Click"</span>, <span style="color: #ff0000;">"Button 1"</span> <span style="color: #000000;">)</span> ;<br /><span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"But.1"</span> ;<br /><span style="color: #0000ff;">FONT</span> oFont1 ;<br /><span style="color: #0000ff;">RIGHT</span><br />oBtn1:<span style="color: #000000;">lTransparent</span> = .t. <br />oBtn1:<span style="color: #000000;">cTooltip</span> := <span style="color: #ff0000;">"Button1"</span><br /><br /><span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">BTNBMP</span> oBtn2 <span style="color: #0000ff;">ID</span> <span style="color: #000000;">110</span> <span style="color: #0000ff;">OF</span> oDlg3 ;<br />NOBORDER ;<br />FILENAME cBUTTON1 ;<br /><span style="color: #0000ff;">ACTION</span> MsgAlert<span style="color: #000000;">(</span> <span style="color: #ff0000;">"Button-Click"</span>, <span style="color: #ff0000;">"Button 2"</span> <span style="color: #000000;">)</span> ;<br /><span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"But.2"</span> ;<br /><span style="color: #0000ff;">FONT</span> oFont1 ;<br /><span style="color: #0000ff;">LEFT</span><br />oBtn2:<span style="color: #000000;">lTransparent</span> = .t.<br />oBtn2:<span style="color: #000000;">cTooltip</span> := <span style="color: #ff0000;">"Button2"</span><br /><br /><span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">BTNBMP</span> oBtn3 <span style="color: #0000ff;">ID</span> <span style="color: #000000;">120</span> <span style="color: #0000ff;">OF</span> oDlg3 ;<br />NOBORDER ;<br />FILENAME cBUTTON1 ;<br /><span style="color: #0000ff;">ACTION</span> MsgAlert<span style="color: #000000;">(</span> <span style="color: #ff0000;">"Button-Click"</span>, <span style="color: #ff0000;">"Button 3"</span> <span style="color: #000000;">)</span> ;<br /><span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"But.3"</span> ;<br /><span style="color: #0000ff;">FONT</span> oFont1 ;<br />TOP<br />oBtn3:<span style="color: #000000;">lTransparent</span> = .t.<br />oBtn3:<span style="color: #000000;">cTooltip</span> := <span style="color: #ff0000;">"Button3"</span><br /><br /><span style="color: #B900B9;">// ----- Transparent Buttons with BORDER ( doesn't work !!!! ) ---------</span><br /><br /><span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">BTNBMP</span> oBtn4 <span style="color: #0000ff;">ID</span> <span style="color: #000000;">200</span> <span style="color: #0000ff;">OF</span> oDlg3 ;<br />FILENAME cBUTTON1 ;<br /><span style="color: #0000ff;">ACTION</span> MsgAlert<span style="color: #000000;">(</span> <span style="color: #ff0000;">"Button-Click"</span>, <span style="color: #ff0000;">"Button 4"</span> <span style="color: #000000;">)</span> ;<br /><span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"But.4"</span> ;<br /><span style="color: #0000ff;">FONT</span> oFont1 ;<br />BOTTOM<br />oBtn4:<span style="color: #000000;">lTransparent</span> = .t. <br />oBtn4:<span style="color: #000000;">cTooltip</span> := <span style="color: #ff0000;">"Button4"</span><br /><br /><span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">BTNBMP</span> oBtn5 <span style="color: #0000ff;">ID</span> <span style="color: #000000;">210</span> <span style="color: #0000ff;">OF</span> oDlg3 ;<br />FILENAME cBUTTON2 ;<br /><span style="color: #0000ff;">ACTION</span> MsgAlert<span style="color: #000000;">(</span> <span style="color: #ff0000;">"Button-Click"</span>, <span style="color: #ff0000;">"Button 5"</span> <span style="color: #000000;">)</span> ;<br /><span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">" "</span> <br />oBtn5:<span style="color: #000000;">lTransparent</span> = .t. <br />oBtn5:<span style="color: #000000;">cTooltip</span> := <span style="color: #ff0000;">"Button5"</span><br /><br /><span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">BTNBMP</span> oBtn6 <span style="color: #0000ff;">ID</span> <span style="color: #000000;">220</span> <span style="color: #0000ff;">OF</span> oDlg3 ;<br />FILENAME cBUTTON3 ;<br /><span style="color: #0000ff;">ACTION</span> MsgAlert<span style="color: #000000;">(</span> <span style="color: #ff0000;">"Button-Click"</span>, <span style="color: #ff0000;">"Button 6"</span> <span style="color: #000000;">)</span> ;<br /><span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">" "</span> <br />oBtn6:<span style="color: #000000;">lTransparent</span> = .t. <br />oBtn6:<span style="color: #000000;">cTooltip</span> := <span style="color: #ff0000;">"Button6"</span><br /><br /><span style="color: #B900B9;">// --------------</span><br /> <br /><span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">BTNBMP</span> oBtn7 <span style="color: #0000ff;">ID</span> <span style="color: #000000;">300</span> <span style="color: #0000ff;">OF</span> oDlg3 <span style="color: #000000;">2007</span> ;<br />FILENAME <span style="color: #ff0000;">"./system/stop.bmp"</span> ;<br /><span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Close"</span> ;<br /><span style="color: #0000ff;">FONT</span> oFont1 ;<br /><span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">(</span> lOPEN<span style="color: #000000;">[</span><span style="color: #000000;">3</span><span style="color: #000000;">]</span> := .F., oDlg3:<span style="color: #000000;">End</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br />oBtn7:<span style="color: #000000;">lTransparent</span> = .t. <br />oBtn7:<span style="color: #000000;">cTooltip</span> := <span style="color: #ff0000;">"Close"</span><br /><br /><span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">SAY</span> oSay3 <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Alpha-Blended BMP"</span> <span style="color: #0000ff;">ID</span> <span style="color: #000000;">230</span> <span style="color: #0000ff;">OF</span> oDlg3 <span style="color: #0000ff;">FONT</span> oFont2 <br />oSay3:<span style="color: #000000;">lTransparent</span> = .t. <br /><br /><span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg3 <span style="color: #0000ff;">CENTERED</span> <span style="color: #0000ff;">NOWAIT</span> ;<br /><span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">INIT</span> <span style="color: #000000;">(</span> oDlg3:<span style="color: #0000ff;">Move</span><span style="color: #000000;">(</span> <span style="color: #000000;">100</span>, <span style="color: #000000;">470</span>, <span style="color: #000000;">430</span>, <span style="color: #000000;">290</span>, .f. <span style="color: #000000;">)</span>, DisableX<span style="color: #000000;">(</span>oDlg3, .T.<span style="color: #000000;">)</span>, ;<br /> oBtn1:<span style="color: #000000;">SetSize</span><span style="color: #000000;">(</span> nButtonW, nButtonH, .T. <span style="color: #000000;">)</span>, ;<br /> oBtn2:<span style="color: #000000;">SetSize</span><span style="color: #000000;">(</span> nButtonW, nButtonH, .T. <span style="color: #000000;">)</span>, ;<br /> oBtn3:<span style="color: #000000;">SetSize</span><span style="color: #000000;">(</span> nButtonW, nButtonH, .T. <span style="color: #000000;">)</span>, ;<br /> oBtn4:<span style="color: #000000;">SetSize</span><span style="color: #000000;">(</span> nButtonW, nButtonH, .T. <span style="color: #000000;">)</span>, ;<br /> oBtn5:<span style="color: #000000;">SetSize</span><span style="color: #000000;">(</span> nButtonW, nButtonH, .T. <span style="color: #000000;">)</span>, ;<br /> oBtn6:<span style="color: #000000;">SetSize</span><span style="color: #000000;">(</span> nButtonW, nButtonH, .T. <span style="color: #000000;">)</span> <span style="color: #000000;">)</span> ;<br /><span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">PAINT</span> <span style="color: #000000;">(</span> D_ALPHA<span style="color: #000000;">(</span> hDC <span style="color: #000000;">)</span>, ;<br /> IIF<span style="color: #000000;">(</span> nSTYLE = <span style="color: #000000;">2</span>, D_GRADIENT<span style="color: #000000;">(</span> hDC, oDlg3 <span style="color: #000000;">)</span>, <span style="color: #00C800;">NIL</span> <span style="color: #000000;">)</span>, ;<br /> IIF<span style="color: #000000;">(</span> nSTYLE = <span style="color: #000000;">5</span>, DL_IMAGE<span style="color: #000000;">(</span> oDlg3 <span style="color: #000000;">)</span>, <span style="color: #00C800;">NIL</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:29hxqcar]
Regards
Uwe <!-- s:lol: --><img src="{SMILIES_PATH}/icon_lol.gif" alt=":lol:" title="Laughing" /><!-- s:lol: -->
|
A Preview on the xBROWSE - Tool
|
Hello,
I finished the job on the xBrowse-Tool.
I think, it will be helpfull for the FWH-users.
The Tool writes the source of the done design.
There are notes included, on Lines, where you have
add your own source.
I' m still waiting for the new release FWH 8.04
to add the new features.
It works together with the Infobar-designer.
The look of the tool will have the design you have done.
When it is finished, i put it in the forum.
When there is still something missing, just tell me.
[img:3dw6zxn6]http://pflegeplus.com/pictures/designer4.jpg[/img:3dw6zxn6]
Regards
Uwe[/img]
|
A Preview on the xBROWSE - Tool
|
DO you Know SETUP COL.prg ?
it' an old application for wbrowse but you can modify easy for xbeowse
|
A Preview on the xBROWSE - Tool
|
Hello, Silvio
Maybe the tool can be helpfull, but i don't know it.
For me, the program has to be a lern-effect
for the new functions and what is possible to do with FWH.
So i try, to find out by myself what to do.
There are also many helpfull informations from
the forum users.
In the end, it could be someting usefull for everybody.
Regards
Uwe
|
A Preview on xBrowse-Tools 2.0 ( new Pages 23 and 4 )
|
Hello,I finished the job on the xBrowse-Tools.Folder-Pages 2,3 and 4 are added.You can test all xBrowse-methods at runtime.The source of each page-test is written to a field,to copy and past in your program.Page 1------Testing of Header and Footer :Gradient and Color, Size, Text-Size and ColorUsing sliders to adjust Header and Footer-heightas well for gradient-adjustment.Page 2------Testing of Styles :Line-Style and Color,Pen-Size, GridPage 3------ Testing Browser Data-part :Row-Colors, Colors ( Row or Col defined ), Fonts ( Color and Size ), Preview of Double lines in Cells,Switching Color-Preview from Rows to Colums.Switching colors A <-> BPage 4------ Background ( Pictures and Brushes )Cell-Bitmaps, Row Focus ( Colors ) Page 1 : Header and Footer[img:2d90vkuo]http://www.pflegeplus.com/pictures/BrowseT1.jpg[/img:2d90vkuo]Page 2 : Styles and Colors[img:2d90vkuo]http://www.pflegeplus.com/pictures/BrowseT2.jpg[/img:2d90vkuo]Page 3 : Data-colors and Fonts[img:2d90vkuo]http://www.pflegeplus.com/pictures/BrowseT3a.jpg[/img:2d90vkuo]Page 4 : Backgrounds and Cell-Bitmaps[img:2d90vkuo]http://www.pflegeplus.com/pictures/BrowseT6a.jpg[/img:2d90vkuo]Using Gradient-Background in xBrowse-Data-area[img:2d90vkuo]http://www.pflegeplus.com/pictures/BrowseT5.jpg[/img:2d90vkuo]There are still some special things, i want to do.( not included in xBrowse, like adjustment of background-imagesto data-size, because brushes are shown tiled )Will be in FWH-Version 8.09.After that, i can put the tools in the forum for download.Best RegardsUwe <!-- s:lol: --><img src="{SMILIES_PATH}/icon_lol.gif" alt=":lol:" title="Laughing" /><!-- s:lol: -->
|
A Preview on xBrowse-Tools 2.0 ( new Pages 23 and 4 )
|
>( not included in xBrowse, like adjustment of background-images to data-size, because brushes are shown tiled )>This feature is already available in xbrowse for quite long time.if oCol:lBmpStretch is set to True, the back ground image of the column is stretched to fit the datawidth. Bmp is streched to fill the entire cell and data is painted over the bitmap
|
A Preview on xBrowse-Tools 2.0 ( new Pages 23 and 4 )
|
Hello from Germany,I don't need it for a col, that is no problem.I have to adjust a brush to the full aerea of the datas.If i resize the browser, the brush ( picture )has to be adjusted to the new browser-size.[img:1lgijrqw]http://www.pflegeplus.com/pictures/xbrowse11.jpg[/img:1lgijrqw]RegardsUwe <!-- s:lol: --><img src="{SMILIES_PATH}/icon_lol.gif" alt=":lol:" title="Laughing" /><!-- s:lol: -->
|
A Preview on xBrowse-Tools 2.0 ( new Pages 23 and 4 )
|
I understand. Still not provided.Wish they provide DATA bPaintBackGround and leave the painting of background to us.
|
A Preview on xBrowse-Tools 2.0 ( new Pages 23 and 4 )
|
Thank you very much for the reply,that is exactly what i mean.That is the trick i used, to show a gradient in the data-erea :I used the WTools, created a nice gradient and selected a partas brush for xbrowse-background.That looks nice, as long you don't resize the browser.( see also toppic : browse-tools 2.0 preview )Uwe <!-- s:lol: --><img src="{SMILIES_PATH}/icon_lol.gif" alt=":lol:" title="Laughing" /><!-- s:lol: -->
|
A Problem using : VTitles Gradient / Base and BtnBmp
|
To Daniel,
I changed a normal Button to BtnBmp inside VTitles, because it looks much better.
All Background-styles are working fine, but not using Gradient and Base.
Is it possible, to fix the Problem ? ( I would like, to keep the round Button ).
Otherwise I have to change the Button-class using Gradient-background.
[color=#FF0000:m8c40hnp]oBar1:aGrdBack := { { nGradPos, nColor1, nColor2 },{ nGradPos, nColor2, nColor1 } }[/color:m8c40hnp]
[img:m8c40hnp]http://www.pflegeplus.com/pictures/about15.jpg[/img:m8c40hnp]
As soon I select a Gradient-background there is a Error ( the Button cannot detect the Gradient ) :
[img:m8c40hnp]http://www.pflegeplus.com/pictures/about16.jpg[/img:m8c40hnp]
[color=#0000FF:m8c40hnp]Application
===========
Path and name: E:\T_MESSAGE\Message.exe (32 bits)
Size: 1,772,032 bytes
Time from start: 0 hours 0 mins 6 secs
Error occurred at: 07/07/11, 21:52:15
Error description: Error BASE/1004 Class: 'NIL' has no exported method: HBITMAP
Args:
[ 1] = U
Stack Calls
===========
Called from: => HBITMAP(0)
Called from: .\source\classes\BTNBMP.PRG => TBTNBMP:PAINT(1267)
Called from: .\source\classes\BTNBMP.PRG => (b)TBTNBMP:TBTNBMP(112)
Called from: => TBTNBMP:DISPLAY(0)
Called from: .\source\classes\CONTROL.PRG => TCONTROL:HANDLEEVENT(1459)
Called from: .\source\classes\BTNBMP.PRG => TBTNBMP:HANDLEEVENT(1450)
Called from: .\source\classes\WINDOW.PRG => _FWH(3394)
Called from: => WINRUN(0)
Called from: .\source\classes\WINDOW.PRG => TWINDOW:ACTIVATE(978)
Called from: .\Message.PRG => MAIN(539)[/color:m8c40hnp]
I got it working, but no Solution of using BASE :
[img:m8c40hnp]http://www.pflegeplus.com/pictures/about17.jpg[/img:m8c40hnp]
[color=#008000:m8c40hnp] aGrad := { { nGradPos, nColor1, nColor2 },{ nGradPos, nColor2, nColor1 } }
oBar1:aGrdBack := {}
hDC = CreateCompatibleDC( oBar1:GetDC() )
hBmp = CreateCompatibleBitMap( oBar1:hDC, oBar1:nWidth, oBar1:nHeight )
hBmpOld = SelectObject( hDC, hBmp )
GradientFill( hDC, 0, 0, oBar1:nHeight, oBar1:nWidth, aGrad )
oBrush := TBrush():New( ,,,, hBmp )
oBrush:Cargo := aGrad
SelectObject( hDC, hBmpOld )
oBar1:ReleaseDC()
oBar1:SetBrush( oBrush )
RELEASE BRUSH oBrush[/color:m8c40hnp]
That doesn't work using BtnBmp :
[color=#FF0000:m8c40hnp]oBar1:aGrdBack := { { nGradPos, nColor1, nColor2 },{ nGradPos, nColor2, nColor1 } } [/color:m8c40hnp]
[color=#FF0000:m8c40hnp]oBar1:aGrdBase := { { nGradPos, nColor1, nColor2 } , ;
{ nGradPos, nColor2, nColor1 } }[/color:m8c40hnp]
Testing with BASE
doesn't crash, but not the expected Result :
[img:m8c40hnp]http://www.pflegeplus.com/pictures/about18.jpg[/img:m8c40hnp]
[color=#FF0000:m8c40hnp]oBar1:lBase := .T.[/color:m8c40hnp]
aGrad := { { nGradPos, nColor1, nColor2 },{ nGradPos, nColor2, nColor1 } }
oBar1:aGrdBack := {}
hDC = CreateCompatibleDC( oBar1:GetDC() )
hBmp = CreateCompatibleBitMap( oBar1:hDC, oBar1:nWidth, oBar1:nHeight )
hBmpOld = SelectObject( hDC, hBmp )
GradientFill( hDC, 0, 0, oBar1:nHeight, oBar1:nWidth, aGrad )
oBrush := TBrush():New( ,,,, hBmp )
oBrush:Cargo := aGrad
SelectObject( hDC, hBmpOld )
oBar1:ReleaseDC()
oBar1:SetBrush( oBrush )
RELEASE BRUSH oBrush
Best Regards
Uwe <!-- s:?: --><img src="{SMILIES_PATH}/icon_question.gif" alt=":?:" title="Question" /><!-- s:?: -->
|
A Problem using : VTitles Gradient / Base and BtnBmp
|
Hello
Please send me a sample, but the ttitle class has not designed like a parent control...
|
A Problem using : VTitles Gradient / Base and BtnBmp
|
Daniel,
Thank You for the Response,
maybe to much work to find and change something inside classes.
[color=#0000FF:3mp5jtke]the ttitle class has not designed like a parent control[/color:3mp5jtke]
I don't know why, but all the things I want to do, somehow I got working.
I found a Solution to change Buttons at Runtime.
Using Base, a normal Button works.
[img:3mp5jtke]http://www.pflegeplus.com/pictures/about19.jpg[/img:3mp5jtke]
Best Regards
Uwe <!-- s:lol: --><img src="{SMILIES_PATH}/icon_lol.gif" alt=":lol:" title="Laughing" /><!-- s:lol: -->
|
A Problem using : VTitles Gradient / Base and BtnBmp
|
Found a working Solution !
[img:j546izbm]http://www.pflegeplus.com/pictures/about20.jpg[/img:j546izbm]
[code=fw:j546izbm]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00C800;">IF</span> nStyle <> <span style="color: #000000;">8</span> <span style="color: #B900B9;">// Button for all Styles NO Base</span><br /> @ nHeight - <span style="color: #000000;">55</span>, nWidth - <span style="color: #000000;">50</span> <span style="color: #0000ff;">BTNBMP</span> oBtn <span style="color: #0000ff;">OF</span> oBar2 ;<br /> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">40</span>, <span style="color: #000000;">40</span> <span style="color: #0000ff;">PIXEL</span>;<br /> NOBORDER ;<br /> <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"&OK"</span> ;<br /> FILENAME c_path + <span style="color: #ff0000;">"<span style="color: #000000;">\B</span>itmaps<span style="color: #000000;">\"</span> + cTButton ;<br /> ACTION MsgAlert( "</span>Exit-<span style="color: #0000ff;">action</span><span style="color: #ff0000;">", "</span>Attention !<span style="color: #ff0000;">" ) ; <br /> FONT oSysFont1 ;<br /> CENTER<br /> oBtn:lTransparent := .t. <br /> oBtn:cToolTip = { "</span>Close <span style="color: #ff0000;">" + CRLF + "</span><span style="color: #0000ff;">Message</span><span style="color: #ff0000;">","</span><span style="color: #0000ff;">Message</span> End<span style="color: #ff0000;">", ;<br /> 1, CLR_BLACK, 14089979 }<br /> oBtn:SetColor( 0, )<br />ELSE // only BASE<br /> @ nHeight - 37, nWidth - 36 TITLETEXT OF oBar2 ;<br /> TEXT "</span>OK<span style="color: #ff0000;">" FONT oSysFont1 COLOR 0<br /> @ nHeight - 52, nWidth - 52 TITLEIMG oBtn OF oBar2 ;<br /> BITMAP c_Path + "</span>\<span style="color: #0000ff;">Bitmaps</span>\<span style="color: #ff0000;">" + cTButton SIZE 48, 48 ANIMA LEVEL 255 ;<br /> ACTION MsgAlert( "</span>Exit-<span style="color: #0000ff;">action</span><span style="color: #ff0000;">", "</span>Attention !<span style="color: #ff0000;">" )<br />ENDIF<br /></span></div>[/code:j546izbm]
Best Regards
Uwe <!-- s:lol: --><img src="{SMILIES_PATH}/icon_lol.gif" alt=":lol:" title="Laughing" /><!-- s:lol: -->
|
A Problem w. autofocus and marquestyle_highlight_cell ?
|
I noticed a problem using xbrowse[color=#0000FF:aalm91z6] [b:aalm91z6]autofocus [/b:aalm91z6][/color:aalm91z6]in combination with MARQSTYLE_HIGHLCELL
The following happens :
MARQSTYLE_HIGHLROW is working ( image 1 )
MARQSTYLE_HIGHLCELL is painting the focus color of [color=#0000FF:aalm91z6]ONE[/color:aalm91z6] cell only, if moving [color=#0000FF:aalm91z6]VERTICAL[/color:aalm91z6] to another row. ( image 2 )
[color=#0000FF:aalm91z6][b:aalm91z6]oBrw:nMarqueeStyle := MARQSTYLE_HIGHLCELL
oBrw:lHoverSelect := .T. // autofocus YES / NO[/b:aalm91z6][/color:aalm91z6]
Selecting another cell inside [color=#0000FF:aalm91z6]the same row[/color:aalm91z6], the focus color of the old cell ( lost focus ) is not deleted and still visible( image 3 )
I added control-fields on top of the browser to find a solution.
A selected column 2 still shows column 4 ( only if changing the column inside [color=#0000FF:aalm91z6]the sane row [/color:aalm91z6]) <!-- s:!: --><img src="{SMILIES_PATH}/icon_exclaim.gif" alt=":!:" title="Exclamation" /><!-- s:!: --> <!-- s:( --><img src="{SMILIES_PATH}/icon_sad.gif" alt=":(" title="Sad" /><!-- s:( -->
To get the col-pos I'm using :
[color=#0000FF:aalm91z6]nColPos := oBrw:SelectedCol():nCreationOrder[/color:aalm91z6]
[img:aalm91z6]http://www.pflegeplus.com/IMAGES/Autofocus3.jpg[/img:aalm91z6]
[img:aalm91z6]http://www.pflegeplus.com/IMAGES/Autofocus1.jpg[/img:aalm91z6]
I still noticed another problem using < oBrw:nMarqueeStyle := MARQSTYLE_HIGHLCELL >
[color=#0000FF:aalm91z6]oBrw:lContrastClr := .F.[/color:aalm91z6] must be defined ( seems to be .T. by default )
otherwise changing the focus, the textcolor in some cells is shown in white on a brushed xbrowse background like the screenshot shows. It works changing oBrw:lContrastClr to .F.
[img:aalm91z6]http://www.pflegeplus.com/IMAGES/Autofocus2.jpg[/img:aalm91z6]
regards
Uwe <!-- s:?: --><img src="{SMILIES_PATH}/icon_question.gif" alt=":?:" title="Question" /><!-- s:?: -->
|
A Problem with MenuItems (or Me!)
|
Hi AntonioI am trying to Disable() / Enable() menuitems as they become valid depending upon what else has happened in a program.The problem is thatMENUITEM <oItem> PROMPT <cPrompt> ACTION <uAction> is setting <oItem> to nil rather than the new menu item. I have modified tutor04.prg to demonstrate the problem:[code:f0obzkcr]#include "FiveLinux.ch"
static oWnd
function Main()
local lVal := .t., cName := "Hello", cItem, cLbx, nVal := 100, oBar
DEFINE WINDOW oWnd TITLE "Testing controls" ;
MENU BuildMenu()
DEFINE BUTTONBAR oBar OF oWnd
DEFINE BUTTON OF oBar RESOURCE "gtk-new" ACTION MsgInfo( "New" )
DEFINE BUTTON OF oBar RESOURCE "gtk-open" ACTION MsgInfo( "Open" )
DEFINE BUTTON OF oBar RESOURCE "gtk-save" ;
ACTION MsgInfo( "Save" ) GROUP
DEFINE BUTTON OF oBar RESOURCE "gtk-quit" ACTION oWnd:End()
@ 9, 1 SAY "A Say" OF oWnd
@ 12, 2 CHECKBOX lVal PROMPT "Click me" OF oWnd
@ 15, 2 GET cName OF oWnd
@ 18, 2 COMBOBOX cItem OF oWnd ITEMS { "one", "two", "three" }
@ 9, 22 LISTBOX cLbx OF oWnd ITEMS { "one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "ten", "eleven", "twelve" }
@ 21, 2 METER nVal TOTAL 200 OF oWnd
@ 24, 2 IMAGE FILENAME "flh.gif" OF oWnd
@ 26, 30 BUTTON "" OF oWnd ACTION MsgInfo( cLbx ) RESOURCE "gtk-ok"
@ 26, 39 BUTTON "" OF oWnd ACTION MsgInfo( cItem ) RESOURCE "gtk-cancel"
SET MSGBAR OF oWnd TO " FiveLinux - (c) FiveTech Software 2008"
ACTIVATE WINDOW oWnd ;
VALID MsgYesNo( "Are you sure ?" ) ;
ON RIGHT CLICK MsgInfo( "right click" )
return nil
function BuildMenu()
local oMenu
local m2 // I added this variable
MENU oMenu
MENUITEM "One"
MENU
MENUITEM "First" RESOURCE "gtk-new" ACTION MsgInfo( "New" )
MENU
MENUITEM "One"
MENUITEM m2 PROMPT "Two" // and modified this line so that m2 should be this menu item
SEPARATOR
MENUITEM "Three"
ENDMENU
MENUITEM "Second" RESOURCE "gtk-quit" ACTION oWnd:End()
ENDMENU
MENUITEM "Two" ACTION MsgInfo( "Two" )
MENUITEM "Three" ACTION MsgInfo( "Three" )
ENDMENU
MsgInfo( ValType( m2 ) ) // I added this MsgInfo which tells us that m2 is Undefined. Why?
m2:Disable() // so this line produces an error.
return oMenu[/code:f0obzkcr]
When I look at FiveLinux.ch I see that the MENUITEM command is being preprocessed into a call to MenuAddItem()
[code:f0obzkcr]#xcommand MENUITEM [ <oMenuItem> PROMPT ] [<cPrompt>] ;
[ ACTION <uAction> ] ;
[ <resource: RESOURCE, NAME, RESNAME> <cResName> ] ;
=> ;
[ <oMenuItem> := ] MenuAddItem( <cPrompt>,;
[ \{|o| <uAction> \} ], <cResName> )[/code:f0obzkcr]I can't find MenuAddItem() but my guess is it must be returning nil. As I can't find it I can't attempt to fix it.But, as always, my diagnosis could be wrong.RegardsDoug
|
A Problem with MenuItems (or Me!)
|
Doug,You are right. There is a bug in FiveLinux\source\classes\pdmenu.prg.function MenuAddItem() has to be modified this way:[code:18izk7sq]
function MenuAddItem( cPrompt, bAction, cResName )
local oItem
ATail( aMenus ):Add( oItem := TMenuItem():New( cPrompt, bAction, cResName ) )
return oItem
[/code:18izk7sq]Thanks for your feedback <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
|
A Problem with MenuItems (or Me!)
|
Hi AntonioThanks so much for the prompt response and bug fix. I still can't achieve what I want. I now realise that TMenu and TMenuItem aren't subclasses of TControl and hence of TWindow. As a result they don't support Disable() or Enable().It would be nice to be able to enable or disable menu items. Failing that to add or delete them.I'm sure I did it in FiveWin. (Don't have the source handy). I did look at the FiveWin documentation and saw that MENUITEM has [ ENABLED | DISABLED ] support.RegardsDoug
|
A Question Abot DIALOGs
|
Hi FiveWinnners
I have some questions about DIALOGs that I probably should have asked some time ago, and maybe just shows that I don't quite understand, but here goes:
OK I have DIALOGS (objects of class TDialog) which I create programmatically. In other words my code looks something like this:
[code:1wuwhpi0]DEFINE DIALOG dlgPATIENT TITLE sTitle SIZE 950, 650
@ 3, 1 SAY "Key" OF dlgPATIENT SIZE 90, 25
// rest of definition
@ 60, 51 BUTTON btnQUIT PROMPT "Quit" ACTION ( ::cExitCode := "Q", dlgPATIENT:End() ) OF dlgPATIENT
ACTIVATE DIALOG dlgPATIENT CENTERED [/code:1wuwhpi0]
So dlgPATIENT points to an object of class TDialog. I want to use that TDialog object many times. But it seems that dlgPATIENT:End() partly destroys it, because if I try to reuse it later with:
[code:1wuwhpi0]ACTIVATE DIALOG dlgPATIENT CENTERED [/code:1wuwhpi0]
The screen will often come up the second time but not properly and is completely skew wiff by the third time.
I assume I have to call dlgPATIENT:End() to stop its message loop. Is that correct? Is there some other way?
Is anyone out there reusing their DIALOGs in such a manner or do you go through your code that creates them (DEFINE DIALOG) each time you need to use them.
Thanks
xProgrammer
|
A Question Abot DIALOGs
|
>Is anyone out there reusing their DIALOGs in such a manner or do you go through your code that creates them (DEFINE DIALOG) each time you need to use them.
You need to call the code each time.
If you need to call it from multiple places, then just put it into a function or a method of a custom class.
James
|
A Question Abot DIALOGs
|
Hi James
Thanks for the quick reply. It's nice to know that it's not just me.
I do build my DIALOGs in class methods so it's not difficult to rebuild them from scratch, just a call.
However I wonder if this lack of re-usability need be the case? Maybe Antonio could comment on the possibility of being able to keep a defined DIALOG in memory ready to go as it were? It would seem to be a lot more efficient both in terms of re-defining the DIALOG and the resultant garbage collection. Most people doing data entry use just a few screens but use them many times over.
Thanks
Doug
(xProgrammer)
|
A Question Abot DIALOGs
|
Doug,
You can hide it ( oDlg:Hide() ) and later on show it ( oDlg:Show() ) again instead of end it.
You may need to create it as non modal, and to simulate modal behavior, disable other windows and dialogs doing oWnd:Disable(). Later on enable them doing oWnd:Enable()
|
A Question Abot DIALOGs
|
As Antonio points out this may be a lot of work.
Are you having a specific problem you are trying to solve, or are you looking for a solution for a problem that may not exist, or a least may not be significant?
James
|
A Question Abot DIALOGs
|
Hi James
I guess I don't have any major problem in that I can and have written functional software as is.
However something that I thought might have worked and would be more efficient didn't work and I wondered why. I like to understand my programming environment and its limitations.
Interestingly Antonio's suggestions are pretty much in line with the general direction I might want to head in with my software. Whilst my modal dialogs are in place the user can't access the top window menu so any actions pretty much have to be buttons on the DIALOG.
Thinking forward it may well be that I should make my DIALOGs non-modal but where necessary enable only a single instance to be created or active at any time.
One type of functionality is to have a calendar dialog that controls other dialogs pertaining to what is happening on a given day at a given site. For each site and day you might want to display staffing, or bookings, or work done etc.
These different aspects would relate to their own classes and it would be nice to keep the UI aspects of them sitting there.
If you think of it the sort of behaviour I am looking for, it is really in keeping with the spirit of OO. Instantiate an object of class X and you can keep it there for repeated use until you destroy it - I am trying to make the UI component of my classes match that paradigm.
I have programmed for a stateless environment but where I have the luxury of state let me use it.
Thanks for your input. I normally have a fairly pragmatic approach to programming, even if this query seems to be an example of the opposite. Indeed I wonder at the effort here consumed on (for example) the style of buttons, whereas I only need much more basic functionality. There's some very clever coding going on behind some of this, and I guess people are attracted by the latest style of button so programmers feel a need to respond, but in reality its all driven by mass marketing and doesn't really improve software usability at all IMHO.
Regards
Doug
|
A Question Abot DIALOGs
|
Doug,
>One type of functionality is to have a calendar dialog that controls other dialogs pertaining to what is happening on a given day at a given site. For each site and day you might want to display staffing, or bookings, or work done etc.
>These different aspects would relate to their own classes and it would be nice to keep the UI aspects of them sitting there.
OK, this sounds like a description of a Single Document Interface (SDI) similar to that of Outlook. I am a big fan of SDI.
I generally don't think of this as a dialog issue, although some dialogs may be used inside a folder, window, etc. although generally they don't look or act like dialogs.
>If you think of it the sort of behaviour I am looking for, it is really in keeping with the spirit of OO. Instantiate an object of class X and you can keep it there for repeated use until you destroy it - I am trying to make the UI component of my classes match that paradigm.
With a SDI I just show and hide the screens.
>Thanks for your input. I normally have a fairly pragmatic approach to programming, even if this query seems to be an example of the opposite.
Noted.
>Indeed I wonder at the effort here consumed on (for example) the style of buttons, whereas I only need much more basic functionality. There's some very clever coding going on behind some of this, and I guess people are attracted by the latest style of button so programmers feel a need to respond, but in reality its all driven by mass marketing and doesn't really improve software usability at all IMHO.
You make valid points but you forget that without sales the usability of the software is of little importance. First you must have sales.
Users will buy a product based on the look of its interface. I even find myself leaning in this direction. If I see a screenshot of a program that has a 10 year old interface design, I am much less inclined to buy it that one with an up-to-date interface. One assumes that the functionality may be as old as the interface.
You may be interested in this article:
Magic and Software Design
<!-- m --><a class="postlink" href="http://www.asktog.com/papers/magic.html">http://www.asktog.com/papers/magic.html</a><!-- m -->
Also, remember that we programmers are of a different species, Homo Logicus. Users have a completely different view of the world than we do.
Regards,
James
|
A Question Abot DIALOGs
|
Hi James
Thanks so much for your interest.
> OK, this sounds like a description of a Single Document Interface (SDI) similar to that of Outlook. I am a big fan of SDI.
Without really being 100% sure what SDI is exactly I am certainly with you there. When I started with xHarbour/FiveWin (now FiveLinux) I was just concerned with getting some productive software out. I certainly didn't want a full MDI implementation because normally my user would be dealing with 1 patient, 1 booking, 1 report whatever. (When we get to bookings there may be a from slot and a to slot when moving a booking but that still doesn't need or even make great sense in MDI.) But they are likely to be dealing with multiple different objects at the same time (like a patient, a booking, a report, a referring physician etc). So I opted for modal dialogs which made coding pretty much straight forward but as you would know isn't the best fit for the real world that the users are facing and that I am modelling in my software. So SDI here we come!
I have yet to embark down the SDI track so I don't rightly know what problems I will face but I would greatly appreciate your advice when I stumble.
> First you must have sales.
I am only too well aware, both from my own experience and watching what products succeed in the market place. But I have also spent some time working as development manager for a fair sized institution and I know the cost of doing some of these things - not just the money but the extended delivery schedules that often result. I am not criticizing programmers driven by market forces but do wish that we could educate people more. I certainly try to.
Thanks and regards
Doug
(xProgrammer)
|
A Question Abot DIALOGs
|
Hello Doug,
May I ask you for an example screen shot of “a booking“.
As I program hotel management software maybe we can
exchange some ideas.
Regards,
Otto
|
A Question Abot DIALOGs
|
Hi Otto
I haven't got that far with my software yet.
Bookings are complex in my situation because a single (nuclear medicine) test is in 2 parts (most of them) on the same day both of which require camera time (different amounts) and also doctor time (which is the other limiting resource in general). Plus different tests take different amounts of time so it is complicated to judge if I do 4 less of these can I do two more of some other test. But that is the sort of arrangement I will have to get down to - a kind of trading scheme.
Booking for say a general practitioner (whatever you call your normal day to day doctor) is much simpler because they just allocate standard time slots and book known long consults into 2 or more contiguous slots.
I plan to pre-schedule slots for the more common tests and implement a trading scheme. But ther are further compliactions in that some doctors don't do some tests and the number of patients they are able to see in a day varies. That is not so bad - have a standard schedule for Dr X at site A on a Monday for example. But then the doctors' roster gets changed for some reason - how do I change pre-scheduled slots with some bookings already allocated to these slots?
I am happy to share any design or code I produce but at the moment there isn't anything to share.
I started with the Patient and Patient-File classes as there was a desperate need for off-site archiving and I am working through classes progressively.
I was involved in the early stages of reviewing a design for bookings in a large hospital but the design got far too complicated.
Hopefully I can be of more help shortly.
Regards
Doug
(xProgrammer)
|
A Question Abot DIALOGs
|
Hi Otto
By the way their current (manual paper-based) system was chaotic and not working to anyone's satisfaction so we are improving that to prove up our ideas for improvement before attempting to implement in code.
Regards
Doug
|
A Question Abot DIALOGs
|
Doug,
>Bookings are complex in my situation because a single (nuclear medicine) test is in 2 parts (most of them) on the same day both of which require camera time (different amounts) and also doctor time (which is the other limiting resource in general). Plus different tests take different amounts of time so it is complicated to judge if I do 4 less of these can I do two more of some other test. But that is the sort of arrangement I will have to get down to - a kind of trading scheme.
This is a classic case for buisness objects that are able to schedule themselves. I highly recommend getting a copy of Buisness Engineering with Object Technology. You can find more about it on my website here:
<!-- m --><a class="postlink" href="http://ourworld.compuserve.com/homepages/jbott/program.htm">http://ourworld.compuserve.com/homepage ... rogram.htm</a><!-- m -->
And there is a link to Amazon where you can buy it used (it is out of print) for 1 cent (plus shipping). I would get a copy ASAP. It discusses the kinds of things you are trying to do. On page 122 there is a section called [i:2s5h6h6c]Techniques for Time Management [/i:2s5h6h6c]in which he discusses creating a scheduling class and a commitment class. He discusses schedules that require multiple resources, and the use of tenative and firm commitments. This sounds like just what you need.
Coincidentally, I am also working on a medical application. Although my portion of it doesn't deal with scheduling, I have done a lot of work defining the domain (patient, provider, operation, etc.) and trying to understand the interaction between the business objects. So, perhaps the three of us (including Otto) can do some collaboration.
James
|
A Question Abot DIALOGs
|
Hi James
Thanks for the advice. I look forward to future discussions.
My code consists of a small module that instantiates the required objects, calls for user logon (via a USER_Class) launches a main window with a menu has a couple of utility functions but all the rest is done via objects that interact with each other.
I read your articles before starting and gained a lot from them - part technical but perhaps more so confidence to just "do it". xBase was fine - I had spent quite atime with dBase then Clipper, albeit a long time ago. And I had done some OO work more recently. But OO and xBase was new and strange but actually easy and fun once I got started. I did deviate a little from your methodology in that I have a DATAFILE_Class but that doesn't do automated "gather and scatter" - I think thats what you called it? It does however control the allocation of keys and the standard fields included in all my tables which are:
who last updated the record (user-key)
what action they took [update|inset|delete]
when this occurred (date and time)
I also have, for example, a PATIENT_LIST_Class and a PATIENT_Class even though both are basically dealing with the same data table.
In Australia the government assigns provider numbers per physical location so I have a DOCTOR_LIST_Class, a DOCTOR_Class, a PROVIDER_LIST_Class and a PROVIDER_Class.
Bookings not only involves the complications of scheduling but also the data that you have is imperfect - so that you can't be certain that the patient's name is spelled correctly and we don't have date of birth and what they are booked in for might be incorrect and they might be referred by a doctor who either isn't in your system or whose name they don't know or are uncertain of. Much of this is resolved when they present, but some details (eg the particular test) can't be resolved they are seen by the doctor or in some cases even later depending upon initial test outcomes.
Also in terms of scheduling some tests involve multiple appointments with required timelines between them so you can't just reschedule one part of such a series.
Regards
Doug
|
A Question Abot DIALOGs
|
Doug,
>I read your articles before starting and gained a lot from them - part technical but perhaps more so confidence to just "do it". xBase was fine - I had spent quite a time with dBase then Clipper, albeit a long time ago. And I had done some OO work more recently. But OO and xBase was new and strange but actually easy and fun once I got started.
Glad to hear all that. I have convinced very few people to start using OOP. It is all very strange at first, but the benefits are tremendous.
>I did deviate a little from your methodology in that I have a DATAFILE_Class but that doesn't do automated "gather and scatter" - I think that's what you called it? It does however control the allocation of keys and the standard fields included in all my tables which are:
>who last updated the record (user-key)
>what action they took [update|inset|delete]
>when this occurred (date and time)
After reading the above I am somewhat concerned that you are missing some OOP understanding.
There is no reason that you couldn't add the above functionality to the existing database class and also get the built in scatter-gather (and all the other good features). You can just subclass TDatabase or my TData class and add your features. May I see your DATAFILE_Class class? Perhaps I can save you some, or lots, of work. BTY, I would not add "_Class" to the class name--it seems redundant.
>I also have, for example, a PATIENT_LIST_Class and a PATIENT_Class even though both are basically dealing with the same data table.
Is you PATIENT_LIST_Class a table and PATIENT_Class a record? Why not call them a Patients class and a Patient class? You really should be using a database class as the basis for a table class. I fear you a making it more difficult than it could be. Is the PATIENT_LIST_Class a subclass of your DATAFILE_Class?
In Australia the government assigns provider numbers per physical location so I have a DOCTOR_LIST_Class, a DOCTOR_Class, a PROVIDER_LIST_Class and a PROVIDER_Class.
Isn't a doctor also a provider? Are you listing them in both files? Or, are you only considering an organization a provider?
The definition we use here is:
[i:2klp45nv][b:2klp45nv]Provider[/b:2klp45nv]- An individual or institution who provides medical care, including a physician, hospital, skilled nursing facility, or intensive care facility.[/i:2klp45nv]
>Bookings not only involves the complications of scheduling but also the data that you have is imperfect - so that you can't be certain that the patient's name is spelled correctly and we don't have date of birth and what they are booked in for might be incorrect and they might be referred by a doctor who either isn't in your system or whose name they don't know or are uncertain of. Much of this is resolved when they present, but some details (eg the particular test) can't be resolved they are seen by the doctor or in some cases even later depending upon initial test outcomes.
How to handle imperfect data is discussed at length in "About Face The Essentials of User Interface Design," also listed on my website. I'm sure this would also be valuable to you.
Some of the techniques I use with "imperfect" or questionable data is to color the fields yellow and perhaps also popup a tooltip explaining what is commonly placed in the field. Also critical fields are colored pink until the data is entered. And you can flag all records with missing critical data and/or questionable data with a flag so they can later be found and resolved.
>Also in terms of scheduling some tests involve multiple appointments with required timelines between them so you can't just reschedule one part of such a series.
Yes, I realize your scheduling is quite complex--this is all the more reason to use objects to do it. Can you write up just a description of the rules that you need to follow to schedule one of these procedures? I always start with a description of the domain before starting coding. Next is usually an entity-relationship diagram. Then I usually code the very simplest model I can just so I can do test senarios to work out the logic. Making them simple makes them much easier to work with. In your case you could come up with a dozen different test procedures and store them in a file so you can use them to test your scheduler class as you are working on it.
James
|
A Question Abot DIALOGs
|
Hi James
Have to go trail an old car (1928 vintage) 720 kilometres for a friend's wedding so can only make quick reply at this stage.
>Isn't a doctor also a provider? Are you listing them in both files? Or, are you only considering an organization a provider?
A doctor is in effect a different provider for each physical address from which he works, so each provider record points to a doctor record. A doctor record may have zero to many provider records pointing to it. If there are zero records pointing to it then the doctor can't function as a provider.
> Is you PATIENT_LIST_Class a table and PATIENT_Class a record?
Yes
> Why not call them a Patients class and a Patient class?
I like PATIENTLIST because it is unequivocal. I have seen the plural name misused too often.
> I fear you a making it more difficult than it could be. Is the PATIENT_LIST_Class a subclass of your DATAFILE_Class?
No. But PATIENTLIST has the object of type DATAFILE that opened the PT_PATIENT datafile as a property so whilst it isn't a subclass it has many of the benefits. This was a deliberate choice partly to ease data back end migration.
xDATAFILE Class follows. You probably need to see some of the other objects to see how it fits together.
[code:1v1xbp7c]/******************************************************************************
* *
* xDATAFILE Class *
* *
* This class encapsulates the functionality of xBase data files *
* *
******************************************************************************/
CLASS xDATAFILE
DATA WorkArea
DATA KeyRecord
DATA Alias
DATA FileName
DATA MsgName
DATA Index1
DATA Index2
DATA Index3
DATA iNumIndx
DATA bSuccess
DATA sMessage
DATA iKey
DATA sKey
DATA iNumIndx
DATA lConsole
DATA lQuit
DATA lShared
METHOD New( WorkArea, KeyRecord, Alias, FileName, MsgName, Index1, Index2, Index3 ) CONSTRUCTOR
METHOD OpenRaw()
METHOD OpenIndexed()
METHOD OpenFile()
METHOD SetIndices()
METHOD Select()
METHOD LockFile()
METHOD LockRecord()
METHOD Unlock()
METHOD Close()
METHOD GoTo( RecNum )
METHOD GoTop()
METHOD GoBottom()
METHOD AppendBlank()
METHOD BOF()
METHOD EOF()
METHOD GetKey()
METHOD RptKey()
METHOD SetKey( xValue )
METHOD KeyValue()
METHOD Seek( Value )
METHOD SetOrder( Index )
METHOD RecCount()
METHOD Save( CallObj )
METHOD FileInfo()
METHOD Skip( SkipCount )
METHOD LastUpdated()
ENDCLASS
METHOD New( iWorkArea, iKeyRecord, sAlias, sFileName, sMsgName, lConsole, lQuit, Index1, Index2, Index3 ) CLASS xDATAFILE
::lConsole := lConsole
::lQuit := lQuit
::WorkArea := iWorkArea
::KeyRecord := iKeyRecord
::Alias := sAlias
::FileName := sFileName
::MsgName := sMsgName
::lShared := .T.
::iNumIndx := PCOUNT() - 7
IF ::iNumIndx < 0
::iNumIndx := 0
ENDIF
IF ::iNumIndx > 0
::Index1 := Index1
IF ::iNumIndx > 1
::Index2 := Index2
IF ::iNumIndx > 2
::Index3 := Index3
ENDIF
ENDIF
ENDIF
RETURN self
METHOD OpenRaw() CLASS xDATAFILE
LOCAL lbRet
SELECT ( ::WorkArea )
lbRet := ::OpenFile()
RETURN lbRet
METHOD OpenIndexed() CLASS xDATAFILE
SELECT ( ::WorkArea )
IF ::OpenFile()
IF ::lConsole
? ::MsgName + " opened in work area " +ALLTRIM( STR( ::WorkArea ) )
ENDIF
::SetIndices()
RETURN .T.
ENDIF
IF ::lConsole
? "Error Opening " + ::sMsgName
ENDIF
IF ::lQuit
QUIT
ENDIF
RETURN .F.
METHOD OpenFile() CLASS xDATAFILE
IF ::lShared
USE ( ::FileName ) ALIAS ( ::Alias ) SHARED
ELSE
USE ( ::FileName ) ALIAS ( ::Alias ) SHARED
ENDIF
/* LOCAL lsFName
lsFName := ::FileName
OPEN lsFName */
IF NETERR()
? "Error opening " + ::FileName
RETURN .F.
ENDIF
RETURN .T.
METHOD SetIndices() CLASS xDATAFILE
DO CASE
CASE ::iNumIndx = 1
SET INDEX TO ( ::Index1 )
?? " Index set to " + ALLTRIM( ::Index1 )
CASE ::iNumIndx = 2
SET INDEX TO ( ::Index1 ), ( ::Index2 )
?? " Indexes set to " + ALLTRIM( ::Index1 ) + ", " + ALLTRIM( ::Index2 )
CASE ::iNumIndx = 3
SET INDEX TO ( ::Index1 ), ( ::Index2 ), ( ::Index3 )
?? " Indexes set to " + ALLTRIM( ::Index1 ) + ", " + ALLTRIM( ::Index2 ) + ", " + ALLTRIM( ::Index3 )
ENDCASE
RETURN .T.
METHOD Select
SELECT ( ::WorkArea )
RETURN
METHOD Unlock() CLASS xDATAFILE
SELECT ( ::WorkArea )
UNLOCK
RETURN
/*
METHOD LockRecord() CLASS xDATAFILE
SELECT ( ::WorkArea )
RETURN RLOCK()
*/
METHOD LockRecord() CLASS xDATAFILE
LOCAL iNumTries
LOCAL lIsLocked
SELECT ( ::WorkArea )
iNumTries := 1
DO WHILE iNumTries < 6
lIsLocked := RLOCK()
IF lIsLocked
RETURN .T.
ENDIF
INKEY(0.5)
iNumTries += 1
ENDDO
MsgInfo( "Unable to lock " + ::FileName )
RETURN .F.
METHOD LockFile() CLASS xDATAFILE
SELECT ( ::WorkArea )
RETURN FLOCK()
METHOD Close() CLASS xDATAFILE
SELECT ( ::WorkArea )
CLOSE
RETURN
METHOD AppendBlank() CLASS xDATAFILE
SELECT ( ::WorkArea )
APPEND BLANK
RETURN ( !NETERR() )
METHOD BOF() CLASS xDATAFILE
SELECT ( ::WorkArea )
RETURN BOF()
METHOD EOF() CLASS xDATAFILE
SELECT ( ::WorkArea )
RETURN EOF()
METHOD GetKey() CLASS xDATAFILE
SELECT ( defWA_KEY )
IF ::KeyRecord < 1
RETURN .F.
ENDIF
IF ::KeyRecord > RECCOUNT()
RETURN .F.
ENDIF
GOTO ( ::KeyRecord )
::iKey := KY_LASTKEY
::iKey += 1
IF RLOCK()
REPLACE KY_LASTKEY WITH ::iKey
UNLOCK
::sKey := PADL( ALLTRIM( STR( ::iKey)), 16, "0" )
RETURN .T.
ENDIF
RETURN .F.
METHOD RptKey() CLASS xDATAFILE
LOCAL liKey
SELECT ( defWA_KEY )
IF ::KeyRecord < 1
RETURN 0
ENDIF
IF ::KeyRecord > RECCOUNT()
RETURN 0
ENDIF
GOTO ( ::KeyRecord )
liKey := KY_LASTKEY
SELECT ( ::WorkArea )
RETURN ( liKey )
METHOD SetKey( xValue ) CLASS xDATAFILE
ALERT( "SetKey" )
SELECT ( defWA_KEY )
IF ::KeyRecord < 1
RETURN .F.
ENDIF
IF ::KeyRecord > RECCOUNT()
RETURN .F.
ENDIF
// ALERT( TYPE( xValue ) )
GOTO ( ::KeyRecord )
IF RLOCK()
REPLACE KY_LASTKEY WITH xValue
UNLOCK
::iKey := xValue
::sKey := PADL( ALLTRIM( STR( ::iKey)), 16, "0" )
RETURN .T.
ENDIF
RETURN .F.
METHOD KeyValue() CLASS xDATAFILE
RETURN ::sKey
METHOD Seek( Value ) CLASS xDATAFILE
LOCAL llFound
SELECT ( ::WorkArea )
SEEK Value
llFound := FOUND()
IF llFound
// ALERT( "Found" )
ELSE
// ALERT( "Not Found" )
ENDIF
RETURN llFound
METHOD SetOrder( Index ) CLASS xDATAFILE
SELECT ( ::WorkArea )
SET ORDER TO ( Index )
RETURN
METHOD RecCount() CLASS xDATAFILE
SELECT ( ::WorkArea )
RETURN RECCOUNT()
METHOD Save( CallObj ) CLASS xDATAFILE
LOCAL llSuccess
SELECT ( ::WorkArea )
CallObj:sLUBy := oUSER:sKey
CallObj:sLUWhen := oDATETIME:Now()
IF CallObj:lInsert
IF ::GetKey()
CallObj:sKey := ::sKey
CallObj:cLUActn := "I"
llSuccess := ::AppendBlank()
ELSE
ALERT("Failed to retrieve key")
ENDIF
ELSE
CallObj:cLUActn := "U"
llSuccess := ::LockRecord()
ENDIF
IF llSuccess
CallObj:Write()
dbCOMMIT()
UNLOCK
ENDIF
RETURN llSuccess
METHOD FileInfo() CLASS xDATAFILE
LOCAL lcRet
LOCAL lcLKey
SELECT ( ::WorkArea )
lcRet := PADR( ::FileName, 16 ) + " WA= " + LTRIM( STR( ::WorkArea ) ) + " has " + ;
LTRIM( STR( RECCOUNT() ) ) + " records - updated " + DTOS( LUPDATE() ) + " last key " + STR( ::RptKey() )
/*
lcRet := PADR( ::FileName, 16 ) + " WA= " + LTRIM( STR( ::WorkArea ) ) + " has " + ;
LTRIM( STR( RECCOUNT() ) ) + " recs - updated " + DTOS( LUPDATE() ) + "last key "
IF EMPTY( ::RptKey() )
lcLKey := "0"
ELSE
lcLKey := STR( ::RptKey() )
ENDIF
lcRet += lcLKey
*/
RETURN lcRet
METHOD Skip( SkipCount ) CLASS xDATAFILE
LOCAL lnCount
IF PCOUNT() < 1
lnCount := 1
ELSE
lnCount := SkipCount
ENDIF
SELECT ( ::WorkArea )
SKIP ( lnCount )
RETURN
METHOD GoTo( RecNum ) CLASS xDATAFILE
SELECT ( ::WorkArea )
GOTO RecNum
RETURN
METHOD GoTop() CLASS xDATAFILE
SELECT ( ::WorkArea )
GOTO TOP
RETURN
METHOD GoBottom() CLASS xDATAFILE
SELECT ( ::WorkArea )
GOTO BOTTOM
RETURN
METHOD LastUpdated() CLASS xDATAFILE
SELECT ( ::WorkArea )
RETURN DTOS( LUPDATE() )
RETURN nil[/code:1v1xbp7c]
|
A Question Abot DIALOGs
|
Doug,
>No. But PATIENTLIST has the object of type DATAFILE that opened the PT_PATIENT datafile as a property so whilst it isn't a subclass it has many of the benefits. This was a deliberate choice partly to ease data back end migration.
>xDATAFILE Class follows. You probably need to see some of the other objects to see how it fits together.
While I applaud your efforts in creating your own class, I think you are making it more difficult than it needs to be.
Probably 98% of the cabability of your class already exists in FW's TDatabase class. You are also dealing with lots of SELECTs and in so doing you are changing the selected workarea and not returning it to where you found it. This is a problem waiting to happen.
If you use alias referencing, e.g. (::cAlias)->(dbgobottom()) in your class, then you don't need to change the selected workarea.
You have:
METHOD GoBottom() CLASS xDATAFILE
SELECT ( ::WorkArea )
GOTO BOTTOM
RETURN
This could be simplified to:
method GoBottom() class xDatafile
return (::cAlias)->(dbgobottom())
And the workarea never gets changed.
But you already get this in TDatabase AND you get the very useful buffering and all the fieldnames are defined automatically. So where is the advantage to your class? How do you handle creating temporary variables to hold data that is being edited (so the user can either cancel or save)? Hand coding?
You could have subclassed TDatabase to add your lastUpdated() method and any other new ones you wanted. This would have only taken you 10 minutes.
Once you start using TDatabase or TData, you never have to deal with workareas again.
oPatient:= TPatient():new()
msgInfo( oPatient:name )
oDoctor:= TDoctor():new()
msgInfo( oDoctor:name )
No more workareas!
As far a backend migration, a subclass is the way to go. If you subclass TDatabase to make your patient class, and later want to use recordset objects, you can create and use a TRecordset class the has all the same methods as TDatabase, and then you can switch to using recordsets by just changing the class definition of TPatientList--you just change one word.
class TPatientList from TDatabase // to use DBFs
class TPatientList from TRecordset // to use recordsets
It doesn't get much easier than that!
James
|
A Question Abot DIALOGs
|
Here is my 2 cents:
I see you are creating pretty much a dbfclass. While you are at it; might as well add logic to the ::open, ::save... methods to manage some kind of triggers.
For example: ONpreOPEN, ONpostOPEN, ONpreINSERT, ONpostINSERT, ONpreDELETE, ONpostDELETE, ONpreUPDATE, ONpostUPDATE, to be stored on DATA elements such as: ::bOnPreSave, ::bOnPostSave, ...
This can be very powerful. I keep the "triggers" for each table stored as code blocks on a array on triggers.prg that gets compiled with all apps. On the ::open() method you ascan for any trigger defined for the specific table and assign accordingly. On_preOPEN o postOPEN you can even set the indexes for the each table and the default order, the rdd to use (I still use NTX, CDX, and ADTs), if shared, etc... . Again all coded on the codeblock. Since "triggers.prg" is linked to all you apps, they all exhibit the very same behavior. Even some business logic can be transfered to these triggers.
One thing I do with triggers is to "log" to an audit file any inserts, updates, deletes, done on some crucial tables to an "audit_log.dbf" table. All I have to do to add "logging" on a table is to add that code block to the triggers for that table.
On the other hand, if you are using ADS, then triggers can be stored on the data dictionary as well, which will make the data even more standard because the trigger will execute even when the table is modified via some other external app over which you have no control.
I specially want to point out that this is the beauty of this computer language (harbour & xharbour). Namely; code blocks and macros. I can't think of any other computer language, Delphi, or even C++, where you can do this. AFAIK, this gives us an "unfair" advantage over all other developers and is one of the reasons we can actually compete with much larger organizations. Just don't tell any one :-)
I hope I made some sense.
Reinaldo.
|
A Question Abot DIALOGs
|
Hi Reinaldo
Glad to see others are taking an interest in our "conversation". Also the points you make are quite enlightening and rather in accordance with my approach. Indeed the standard fields I add were originally developed in pre ready access to internet/VPNs days and allowed audit trails to be exchanged overnight by modem and two servers in different geographical locations re synchronised. For each data table you had an audit table where no matter what the operation on the data table (insert, update or delete) you always do an insert into the audit trail.
Regards
Doug
|
A Question Abot DIALOGs
|
Hi James
Have to go in less than an hour so this will of necessity be brief.
We have slightly differing philosophical approaches to OO which is healthy. And in no way do I want to imply that I'm right / you're wrong. I will explain my reasons for having chosen the architecture I have and at the same time listen to yours in the belief that if we both explain our ideas both of us and potentially others listening in will be the wiser for it.
I take your point about "scatter / gather" but please note that scatter/gather could be implemented in my architecture (not subclassing xDATAFILE class but merely pointing to it) equally as in your architecture. Part of my reason for not implementing (ceratainly the TData way - if that's the one Antonio provides) is the restriction on field names - I find the current 10 character limit already a nuisance. And auto generating from table is a no-brainer. Plus often you are in situations where you only need to read a couple of fields from a table not the lot.
To me having PATIENT (for example) inherit from xDATAFILE is using OO as a mechanism but is distorting it slightly. A Patient isn't a Table or even a record. Pragmatically this may not matter if the more natural inheritance that may exist is not required and all the natural objects map easily to single tables but I believe this approach can break down.
That's theory. Let's consider it in practice. OK take PATIENT. One object architecture I have considered in the past is to have a class PERSON and have both PATIENT and DOCTOR inherit from it.
There's code in PATIENT and DOCTOR and PATIENTFILE etc that is the same or similar and the same applies for the list variants of each so I may end up having xSINGLE and xLIST as base classes.
Some of my entities will relate to more than one table, others to none so to me deriving directly from TData or an equivalent by subclassing is potentially a problem in the long run. Also some entities are persisted partly as a table entry partly in other ways (eg a MEDICALREPORT which is a word processing document).
I understand that changing the data backend with your approach only requires a single line in each class to be changed - in practice we would use conditional compilation or some such trick to avoid this. In my approach (if you did gather/scatter) you wouldn't have to change anything at all in your classes.
I'm not suggesting you change your architecture, but hoping to explain why I have chosen mine. And hoping we both gain a deeper insight in the process.
I love discussing our craft - although we all have code to get out. Unfortunately I have to go do something else for a few days.
Regards
Doug
(We all agree on the best, most natural programming language, but our styles still differ. That makes it all the more interesting.)
|
A Question Abot DIALOGs
|
>Part of my reason for not implementing (ceratainly the TData way - if that's the one Antonio provides) is the >restriction on field names - I find the current 10 character limit already a nuisance.
It is good that we can use longer names but be aware. Code becomes so unreadable.
From my experience I do some VB6 + NET coding, too.
From the spirits that I called. Sir, deliver me!
Regards,
Otto
[code:228a9jdb]Using driveSearcher As New ManagementObjectSearcher(wmiQuery)
Using driveCollection As ManagementObjectCollection = driveSearcher.[Get]()
For Each moItem As ManagementObject In driveCollection
driveSerialnumber = Convert.ToString(moItem("VolumeSerialNumber"))
Next
End Using
End Using [/code:228a9jdb]
|
A Question Abot DIALOGs
|
Doug,
FWH Class TDataBase is no longer limited to 10 chars
|
A Question Abot DIALOGs
|
Doug,
>We have slightly differing philosophical approaches to OO which is healthy. And in no way do I want to imply that I'm right / you're wrong. I will explain my reasons for having chosen the architecture I have and at the same time listen to yours in the belief that if we both explain our ideas both of us and potentially others listening in will be the wiser for it.
I am not trying to convince you to do things my way, I just think you are making it more difficult than it should be. One of the greatest advantages of OOP is using inheritance to make things simpler, and I think that you are not fully understanding it.
>I take your point about "scatter / gather" but please note that scatter/gather could be implemented in my architecture (not subclassing xDATAFILE class but merely pointing to it) equally as in your architecture.
I'm sure it could be, but it requires lots of coding--and it seems that you would need to hand code it for each class. If you use TDatabase or TData, there is no coding required.
>Part of my reason for not implementing (certainly the TData way - if that's the one Antonio provides) is the restriction on field names - I find the current 10 character limit already a nuisance. And auto generating from table is a no-brainer.
Again this requires you to hand code each class. Lots more work. I have never found the fieldname length to be an issue. If you really wanted to, you could still add a longer name for any field or fields, by adding them as DATA and adding modified load and save methods. So, you would only have to do a very small amount of hand coding.
[code:1oj0z4g4]class TPatient from TData
DATA veryLongFieldName
method save
method load
endclass
method load() class TPatient
super:load()
::veryLongFieldName:= ::shortName
return nil
method save() class TPatient
::shortName:= ::veryLongFieldName
return nil[/code:1oj0z4g4]
Thats all you need. This is much less work than hand coding a load and save method for every class. This could be hundreds or thousands of lines of code.
>Plus often you are in situations where you only need to read a couple of fields from a table not the lot.
I have never found that reading and writing all the fields caused a noticeable slowdown. We were used to only reading and writing the fields we were using in the old days, but having it all done automatically without any programming far outweighs any tiny speed gain if it actually exists. Remember that disk reads and writes are buffered so there may not be any speed gain.
Additionally, reading and writing only certain fields means that you have to have different load and save methods for each situation. This violates the polymorphism rule of OOP. You can't just call oObject:load() you have to use oObject:load1(), oObject:load2(), etc. depending on the situation. So you can't do generic things like pass any object to a function:
[code:1oj0z4g4]function whatever( oObject )
oObject:load()
return nil[/code:1oj0z4g4]
>To me having PATIENT (for example) inherit from xDATAFILE is using OO as a mechanism but is distorting it slightly. A Patient isn't a Table or even a record. Pragmatically this may not matter if the more natural inheritance that may exist is not required and all the natural objects map easily to single tables but I believe this approach can break down.
I'm sorry, I don't understand what you are saying.
>That's theory. Let's consider it in practice. OK take PATIENT. One object architecture I have considered in the past is to have a class PERSON and have both PATIENT and DOCTOR inherit from it.
>There's code in PATIENT and DOCTOR and PATIENTFILE etc that is the same or similar and the same applies for the list variants of each so I may end up having xSINGLE and xLIST as base classes.
You can do this with TDatabase and TData.
[code:1oj0z4g4]class TPerson from TData
method age()
endclass
method age() class TPerson
...
return nAge
class TDoctor from TPerson
endclass
class TPatient from TPerson
endclass
msgInfo( oDoctor:age() )
msgInfo( oPatient:age() )[/code:1oj0z4g4]
Not a problem.
>Some of my entities will relate to more than one table, others to none so to me deriving directly from TData or an equivalent by subclassing is potentially a problem in the long run. Also some entities are persisted partly as a table entry partly in other ways (eg a MEDICALREPORT which is a word processing document).
I am not clear on what you are saying above, but I am pretty sure you can do this using TDatabase or TData. An object can contain other objects, so for instance an invoice object can contain a line item object and a customer object. Additionally, a class could load and save data to more than one table by just creating new load and save methods.
>I understand that changing the data backend with your approach only requires a single line in each class to be changed - in practice we would use conditional compilation or some such trick to avoid this. In my approach (if you did gather/scatter) you wouldn't have to change anything at all in your classes.
By subclassing TDatabase or TData to an intermediate class (which I always recommend) you can reduce the coding change to one line (total).
class TXData from TData
endclass
Then you build all your other classes by inheriting from TXData. Then if you want to change all of them to using recordsets, you just change the one word, TData, to TRecordset and recompile.
>I'm not suggesting you change your architecture, but hoping to explain why I have chosen mine. >And hoping we both gain a deeper insight in the process.
My concern is still that you don't fully understand OOP and as a consequence you are making much more work for yourself. So far I haven't heard anything that you are doing that couldn't be done with MUCH less work using an existing database class as the base class. Many people, including myself, when first learning OOP still keep falling back into the old procedural style of programming because they don't grasp the power of inheritance.
Using inheritance, you could have created your XDatafile class like this:
[code:1oj0z4g4]class XDatafile from TDatabase
method LastUpdated()
endclass
METHOD LastUpdated() CLASS xDATAFILE
RETURN DTOS( ::lupdated )[/code:1oj0z4g4]
Isn't that a LOT less work? It has all the capability of your class and much more (including automatic gather and scatter).
>Unfortunately I have to go do something else for a few days.
We will await your return and response.
Regards,
James
|
A Question Abot DIALOGs
|
Hi Antonio
> FWH Class TDataBase is no longer limited to 10 chars
That's good. From memory I think it was initially a 9 character limit as documented and I use all 10 allowed in the "standard" because of my naming scheme.
For example my data file might be PT_PATIENT with fields such as PT_KEY, PT_FAMLYNM, PT_GIVENNM etc.
I know xBase supports alias->fieldname but not SQL (you end up using AS) and I like ease of portability and guaranteeing all fieldnames unique is a highly desirable feature IMHO.
My variable names reflect type and so field PT_KEY would be sKey as a memory variable. It's association with the Patient object being obvious from either the :: within the PATIENT class itself or from being oPatient:sKey from outside. (Note that I distinguish between a string (s) and a character (c) - again not necessary for xBase alone. I also distinguish an integer (i) for example)
Regards
Doug
|
A Question Abot DIALOGs
|
Hi James
>> I take your point about "scatter / gather" but please note that scatter/gather could be implemented in my architecture (not subclassing xDATAFILE class but merely pointing to it) equally as in your architecture.
> I'm sure it could be, but it requires lots of coding--and it seems that you would need to hand code it for each class. If you use TDatabase or TData, there is no coding required.
No - only once - in xDATAFILE
> Additionally, reading and writing only certain fields means that you have to have different load and save methods for each situation. This violates the polymorphism rule of OOP. You can't just call oObject:load() you have to use oObject:load1(), oObject:load2(), etc. depending on the situation. So you can't do generic things like pass any object to a function
It doesn't stop you from having a generic oObject:load(). But if you truly followed that mantra you couldn't possibly write any system with any level of complexity using SQL if you wanted any reasonable level of performance.
>>Some of my entities will relate to more than one table, others to none so to me deriving directly from TData or an equivalent by subclassing is potentially a problem in the long run. Also some entities are persisted partly as a table entry partly in other ways (eg a MEDICALREPORT which is a word processing document).
> I am not clear on what you are saying above, but I am pretty sure you can do this using TDatabase or TData. An object can contain other objects, so for instance an invoice object can contain a line item object and a customer object. Additionally, a class could load and save data to more than one table by just creating new load and save methods.
Precisely! An object can contain other objects. Thats what mine do. So the PATIENT Class contains
DATA oDbf
which is an object of type xDATAFILE
A PATIENT_REPORT class might (if I were coding in Windows) contain:
DATA oDbf
DATA oWordDoc
In effect we are doing the same thing only you are using subclassing as a mechanism, I am using pointers to other objects as my preferred mechansim. I think mine is cleaner, more flexible, more transportable and more reflective of the real world. You may well think otherwise, but in reality the difference either way is small. But I don't like to encourage people to think in terms of data files rather than objects which I think subclassing most objects from a data file class may do in the case of people less experienced than yourself.
> My concern is still that you don't fully understand OOP and as a consequence you are making much more work for yourself.
I think you may have misjudged me based on my decision not to do automated scatter/gather and to write my own xDATAFILE Class. Both were conscious decisions and neither really justify your conclusion. Quite some years ago now I wrote a dynamic web application development/delivery architecture that led me to a structure that followed OO mechanisms in a stateless environment and reinforced the value of this approach in my thinking. (That may not make a lot of sense but to explain it fully would take too long).
Clearly xDATAFILE or any equivalent is pretty fundamental to any application and I was happier using one I wrote, and so understood. It did also, interestingly enough, require a slight modification when I moved to linux, otherwise backups were incomplete if a user was still logged in to the software (even in its single user guise). It also only took a few hours maximum to write and test.
I would like to repeat that a patient (represented by an object of class PATIENT) is not an example / subclass / whatever of a data table record (represented by part of an object of type xDATAFILE) although there is clearly a corellation between them. Furthermore a list of patients is a different object from a single patient and I believe should be different classes. If they are in the one and the same class you would, it seems to me, be in flagrant contradiction of your own polymorphism mantra - what does oObject:load() do - load one or load a list?
Using classes and inheritance gives a range of advantages. True they can cut coding and solve problems of variable "life" (sorry - can't remember technical term) largely removing the need for public variables. And you have obviously fervently used them for these purposes. But there is also another aspect as to how they relate to their counterparts in the real world and maybe you aren't seeing their full potential in that regard.
Regards
Doug
|
A Question Abot DIALOGs
|
Hi Otto
> It is good that we can use longer names but be aware. Code becomes so unreadable.
I couldn't agree more! I hate ThoseFunctionsWithImpossiblyLongNames()
Personally I would be happier with a 12 or perhaps 16 character limit as witha 10 limit I effectively restrict myself to 7 characters due to my naming scheme (which started out with corporate work with SQL where there is no such limit).
I also like to keep comments relatively short and minimalist. Years ago I read a study that showed that professional programmers could debug other people's code more rapidly if given code with all the comments stripped out!. The authors surmised that the human brain is limited as to the size of the structure it can understand and lots of comments make it too hard to "see" how the code is actually structured.
But when I had to suffer a university course in programming (as part of a commerce degree) they taught the exact opposite. The first assignment was to generate a Fibonacci series ( 1 1 2 3 5 8 13 21 etc). Soon overflows. So I wrote a set of routines to handle 120 digit integers and produced a listing of all Fibonacci numbers up until the 120 digit limit was exceeded and then exited gracefully with a message. I got less marks than a person whose program didn't work at all - it couldn't even generate the first 5 Fibonacci numbers. But according to our lecturer it was well documented! So I knew the rules and got full marks thereafter. But I also began to realise why the graduates turned out by our universities have to be re-trained if they are going to be much use at all.
Regards
Doug
|
A Question Abot DIALOGs
|
Doug,
>>> I take your point about "scatter / gather" but please note that scatter/gather could be implemented in my architecture (not subclassing xDATAFILE class but merely pointing to it) equally as in your architecture.
>> I'm sure it could be, but it requires lots of coding--and it seems that you would need to hand code it for each class. If you use TDatabase or TData, there is no coding required.
>No - only once - in xDATAFILE
Hmm, can you show us a small example? I am having a hard time seeing how you could write a generic gather/scatter routine. I would think that you would have to create data elements for each fieldname and assign them in both the gather and scatter methods and this would have to be done for each class. And you would have to define all the data elements in the table class also.
[code:u3q00l3f]method load() Class TPatientList
::name:= ::cAlias->PT_NAME
::city:= ::cAlias->PT_CITY
return nil
method load() Class TPatient
::name:= ::oPatientList:name
::city:= ::oPatientList:city
return nil[/code:u3q00l3f]
With TDatabase and TData fieldname are automatically generated as DATA so you can do:
oPatientList:= TData():new(,"patients")
oPatientList:use()
msgInfo( oPatientList:name ) // returns James
And then you can change the data in the name var:
oPatientList:name:= "Doug"
msgInfo( oPatientList:name ) // returns Doug
This buffered data, the disk record still contains "James" until you do a save(). So you can use these in controls and if the user selects OK you do a oPatientList:save() otherwise you do nothing and the disk record remains as it was.
Note that there were only two lines of code needed to get this object by using the generic TData class. We can use the same code and only change the filename to get a different object and it knows all the fieldnames of that database.
oOrderList:= TData():new(,"orders")
oOrderList:use()
msgInfo( oOrderList:orderID )
A subclass for a patientlist class could be as simple as:
[code:u3q00l3f]class TPatientList from TData
method new()
endclass
method new() class TPatientlist
super():new(,"patients")
if ::use()
::setOrder(1)
::gotop()
endif
return self[/code:u3q00l3f]
Then you can do:
oPatientList:= TPatientlist():new()
msgInfo( oPatientlist:name )
>> Additionally, reading and writing only certain fields means that you have to have different load and save methods for each situation. This violates the polymorphism rule of OOP. You can't just call oObject:load() you have to use oObject:load1(), oObject:load2(), etc. depending on the situation. So you can't do generic things like pass any object to a function.
>It doesn't stop you from having a generic oObject:load(). But if you truly followed that mantra you couldn't possibly write any system with any level of complexity using SQL if you wanted any reasonable level of performance.
If you use a TRecordset class then you can select whatever fields you wish:
oPatientList := TRecordset():new( "SELECT name, city FROM Patientlist , "Provider=Microsoft.Jet.OleDB.4.0;Data Source=Northwind.mdb" )
oPatientList:city:="San Francisco"
oPatientList:save()
The recordset contains only the fields you specify and the save() method only updates those fields. Again here we have used nothing but a generic TRecordset class.
...
>In effect we are doing the same thing only you are using subclassing as a mechanism, I am using pointers to other objects as my preferred mechanism. I think mine is cleaner, more flexible, more transportable and more reflective of the real world. You may well think otherwise, but in reality the difference either way is small.
OK. However, I am still having a hard time grasping your design.
>But I don't like to encourage people to think in terms of data files rather than objects which I think subclassing most objects from a data file class may do in the case of people less experienced than yourself.
I agree with you and I did discuss this in one of the articles on my website. There is a difference between a patient object and a patient table. I have not discussed this much on the forum because I have a hard enough time getting others interested in using OOP without confusing them too much.
>> My concern is still that you don't fully understand OOP and as a consequence you are making much more work for yourself.
>I think you may have misjudged me based on my decision not to do automated scatter/gather and to write my own xDATAFILE Class. Both were conscious decisions and neither really justify your conclusion.
OK, are you saying that you are having to write more code but you think it is worth it, or are you saying the you don't have to write more code with your design?
>I would like to repeat that a patient (represented by an object of class PATIENT) is not an example / subclass / whatever of a data table record (represented by part of an object of type xDATAFILE) although there is clearly a correlation between them. Furthermore a list of patients is a different object from a single patient and I believe should be different classes. If they are in the one and the same class you would, it seems to me, be in flagrant contradiction of your own polymorphism mantra - what does oObject:load() do - load one or load a list?
As with other code there are tradeoffs. I also have a TRecord class which I use as the base of a TPatient class.
oPatientList:= TData():new(,"patients")
oPatientList:use()
msgInfo( oPatientList:name )
Or you can do (in addition to the above):
oPatient:= TRecord():new( oPatientList )
msgInfo( oPatient:name )
For some routines it is just faster to use the table class only.
The generic TRecord class only has new(), load(), save(), and end() methods. It also automatically adds all the fieldnames as DATA. Normally, I would subclass this and add any methods specific to a patient, like age() for instance.
Like yours, my patient class would contain in instance of the patient table. The patient object reads and writes its data to the table object. The big difference is that mine automatically generates fieldnames as DATA and they are buffered. This is inherited.
You could have an instance of a record class in the table class but I fear it would slow it down when you are doing browses and reports. Is this how you are doing them?
>Using classes and inheritance gives a range of advantages. True they can cut coding and solve problems of variable "life" (sorry - can't remember technical term) largely removing the need for public variables. And you have obviously fervently used them for these purposes. But there is also another aspect as to how they relate to their counterparts in the real world and maybe you aren't seeing their full potential in that regard.
Yes, I don't use any publics. And I do design my objects based real-world objects--I am a big advocate of doing this. Glad to hear that you are also.
Are you saying you never use inheritance?
Regards,
James
|
A Question Abot DIALOGs
|
Hi James
Our techniques vary, but we are actually more similar than someone casually reading these posts might imagine.
Yes I do use inheritance, but somewhat less than you in that I use xDATAFILE via class properties rather than direct inheritance.
I don't currently use any form of generic scatter / gather but I do buffer all data and updates are only written after the user confirms that they want to update / write. (Actually I mostly make user select record in read only mode and hit an edit button in order to go into edit mode - slows things down a bit but is safer.)
The only public variables I use relate to my objects themselves, and maybe they should be in an application class? Currently, however, I have:
[code:xhirnx1e]PUBLIC oPatient
dbfPATIENT := xDATAFILE():New( 1, 1, "PT", "PT_PATIENT", "Patient Master", .T., .T., "PT_KEY", "PT_NAME" )
dbfPATIENT:OpenIndexed()
oPATIENT := PATIENT():Create( dbfPATIENT )[/code:xhirnx1e]
This means that any class can access the currently selected patient, for example, without having to pass the patient object to it. Maybe you have a suggestion?
Regards
Doug
|
A Question Abot DIALOGs
|
Doug,
>I do use inheritance, but somewhat less than you in that I use xDATAFILE via class properties rather than direct inheritance.
I'm still confused. You said you had a patientList class but below you are just using an instance of the xDATAFILE class as the list object. Can we see your patientList class? When is it used instead of an instance of xDATAFILE?
One advantage of using inheritance for your patientList class is that this line:
dbfPATIENT := xDATAFILE():New( 1, 1, "PT", "PT_PATIENT", "Patient Master", .T., .T., "PT_KEY", "PT_NAME" )
Can become this:
oPatientList:= TPatient():new()
Your patientList class is simply:
[code:266fqsor]class TPatientList from xDATAFILE
method new()
endclass
method new() class TPatientList
super():new( 1, 1, "PT", "PT_PATIENT", "Patient Master", .T., .T., "PT_KEY", "PT_NAME" )
return self[/code:266fqsor]
The calling code is shorter, easier to read, and if you later want to change any of the parameters that you use to create the patientList object, you can change them in one place rather than everyplace that you create a patient list as you have to do now.
Also, you can use inheritance to override a method for one class. Say you want to record the last date and time the record was saved, but only for the patient records. You can inherit from xDATAFILE and add a new method save() which records the date and time. Yes, you could manually assign these values when you save the data, but you have to remember to do it whenever you save a record. If it is built into the save method it only has to be coded once.
[code:266fqsor]method save() class TPatient
::lastDate:= date()
::lastTime:= time()
return super():save()[/code:266fqsor]
>I don't currently use any form of generic scatter / gather but I do buffer all data and updates are only written after the user confirms that they want to update / write. (Actually I mostly make user select record in read only mode and hit an edit button in order to go into edit mode - slows things down a bit but is safer.)
OK, so you do have to hand code every scatter and gather routine.
Making the user select Edit is definitely not a Windows standard and does create more work for the user. It is one of our jobs as programmers to make less work for the user. I don't see why it is safer; unless the user presses the OK button, any changes they made (intentionally or accidentally) will not be saved.
>The only public variables I use relate to my objects themselves, and maybe they should be in an application class? Currently, however, I have:
>Code:
>PUBLIC oPatient
>dbfPATIENT := xDATAFILE():New( 1, 1, "PT", "PT_PATIENT", "Patient Master", .T., .T., "PT_KEY", "PT_NAME" )
>dbfPATIENT:OpenIndexed()
>oPATIENT := PATIENT():Create( dbfPATIENT )
Is there a reason you used Create() as your constructor method rather than the standard New()? This is a violation of the polymorphism principle.
>This means that any class can access the currently selected patient, for example, without having to pass the patient object to it. Maybe you have a suggestion?
One way is to create a set/get function that contains a static object var.
Then you can do:
getPatient( Patient():Create( dbfPatient ) )
Now you can do:
local oPatient := getPatient()
msgInfo( oPatient:name )
But since the getPatient function returns an object you can use this shorter syntax and you don't have to create a local.
msgInfo( getPatient():name )
OK, that is one solution but it is very limited. Assuming you either now have, or will have, other values that you need global access to, it would be better to create a global class, TSystem, and include oPatient as one of the DATA elements. You still store the oSystem object in a set/get function and then you have access to all the system data anywhere in the program without any PUBLICS.
However, I don't see why you want to avoid having to pass a patient object to another object. OOP is supposed to work by passing objects. There is not much coding difference between:
patientReport():new()
and,
patientReport():new( oPatient )
And there are cases where it is more code:
[code:266fqsor]do while ! oPatientList:eof()
oPatient:= := PATIENT():Create( oPatientList )
patientReport():new( )
enddo[/code:266fqsor]
Or,
[code:266fqsor]do while ! oPatientList:eof()
patientReport():new( Patient():Create( oPatientList ) )
enddo[/code:266fqsor]
Also, it can get confusing if you have both a public oPatient and a local oPatient.
Another issue that it is a violation of the encapsulation principle of OOP. Any given method should not have to rely on the public var oPatient to contain the patient object that it may need. Suppose that you have the public oPatient set and then you call another object to execute a routine that requires it to lookup another patient record. Does the other routine assume the that the public oPatient contains the record it needs, or does it change oPatient to the one it needs? With encapsulation the routine assumes nothing and the calling routine doesn't need to do anything before calling the other routine.
It still seems to me that you are falling back into procedural programming principles when OOP can serve you better.
Regards,
James
|
A Question Abot DIALOGs
|
Hi James
I really need some time to digest all your comments!
However I was lying in bed this morning musing over why two programmers with, I think, fairly similar fundamental beliefs, have xBase OOP styles that are fairly different. (just woken up!)
Two of the influences on me that have had an impact on my style are:
1. Three tier clent/server programming (that Microsoft was pushing) which amongst other things called for the separation of UI, business rules, and persistence. The UI and business rule layers had to be independant of how and where the data was stored.
2. The shift to xml for data transport with style separated out as CSS or XSTL.
When I wrote my web application delivery technology there was a translation capability so that the calling object could use different tag names from the object that it called. (Data was passed as xml.)
Whilst my code isn't exactlly three tier, it does pretty much conform to the general idea. If you use automated scatter/gather as I understand its current form, then your UI layer has to be aware of the field names that data is stored under. That becomes a problem when you try and hook into existing data or existing objects. If the software you are writing will ever only be a standalone application then it isn't an issue.
Also, unlike you, whilst I am not new to xBase, a windows GUI or OOP but to xBase with either OOP or a windows GUI let alone both. So I am coding my objects pretty much by hand from scratch. Then as patterns occur the degree to which I harness the power of inheritance will increase.
Regards
Doug
|
A Question Abot DIALOGs
|
Doug,
>The UI and business rule layers had to be independant of how and where the data was stored.
This is a good point and I was trying to show how that was accomplished. I have a TData class for DBF access, a TRecordset class for SQL recordset access, and a TArray class for array access. These all were written using polymorphism, so they all have the same methods and data. Any class can be substituted for the other so you can access data in all those formats. I haven't attempted to write a TXML class yet, but I am sure it could be done.
Routines that use tables, like browses and reports, are not affected by switching the datasource class.
The business rules would exist either in the table subclass of any of the above data source classes, and in the real-world objects such as Patient.
So the data source is independent of the business rules.
Using inheritance, the table subclasses can be very small. Anther OOP principle is to move as much code as possible as far up the inheritance ladder as possible. This means you have to write less code in all the subclasses.
James
|
A Question Abot DIALOGs
|
Hi James
I am 100% with you on that.
My only point would be that automatic scatter gather means that the UI layer has to be aware of the fieldnames used by the data layer.
Clearly the Read(), Write() and Blank() methods of my classes can be automatically generated from the datafile so hand coding isn't really required. Thereafter you can change fieldnames in just Read() and Write() without any upstream effects. This is just an interim. Ideally your design tool generates both the data table and the above methods for you. And can do more because it knows, for example, which field is a primary key, which are secondary keys, which character fields are codes, which are dates in string format etc. This isn't very hard to do - I have done it in other environments. But I am waiting until I have coded more by hand to better understand what I need to generate and what information I need to do that. I will also be reviewing all your comments as part of that process.
And when I move (regretfully) to SQL (I would really prefer an OO database) I will have to write a Recordset class.
And I will no doubt be doing an XML class - or using xHarbour's inbuilt ones (have just done a bit with them so not too clear there).
And a WPDocument class - which as I will be using OpenOffice and its xml based format will probably be a subclass of my XML class.
And a MedicalReport class - which will be a subclass of a WPDocument.
Regards
Doug
|
A Question Abot DIALOGs
|
Doug,
>My only point would be that automatic scatter gather means that the UI layer has to be aware of the fieldnames used by the data layer.
They are.
>Clearly the Read(), Write() and Blank() methods of my classes can be automatically generated from the datafile so hand coding isn't really required...
I see you plan to use a code generator.
And a WPDocument class - which as I will be using OpenOffice and its xml based format will probably be a subclass of my XML class.
>And a MedicalReport class - which will be a subclass of a WPDocument.
I suggest thinking about making reports in XML in the sense that it stores the data for retrieval and uses a separate format file to generate the onscreen or printed report. This is what I am doing with the Operative Report I am currently working on. There are already semi-standards for many medical reports.
James
|
A Question Abot DIALOGs
|
Hi James
>> My only point would be that automatic scatter gather means that the UI layer has to be aware of the fieldnames used by the data layer.
> They are.
But it would be preferable if they didn't need to be.
> I suggest thinking about making reports in XML in the sense that it stores the data for retrieval and uses a separate format file to generate the onscreen or printed report. This is what I am doing with the Operative Report I am currently working on. There are already semi-standards for many medical reports.
I would love to. My problem is that a lot of the report is not generatable from my software or any other automated system, but rather is dictated by the physician and typed by the secretary. Final editing may be done by either, depending upon the physician's choice. I don't know if I can move them away from this dependance on a word processor - although I would love to. Generating an xml file which is then edited using a word processor (in this case OpenOffice) is a half way solution.
I would be most interested to hear how you might handle such a situation. Also how best to follow up on any proposed xml coding "standards" for such documents.
I do greatly appreciate the comments you are making, and the time and effort you are putting into them. I do have my own perspective on things and have come to this point via different experiences and may come across as a "difficult bastard" (to use a bit of Australian vernacular) at times. But I've always believed in robust discussion of software architecture. Sometimes people in on a design discussion I am having with a good friend of mine (we have both worked for each other at times) think we must be bitter enemies, but in fact we are good friends and at the end of the day have explored the possibilities and really understand why we have chosen the architecture we have and what to expect from it.
Regards
Doug
|
A Question Abot DIALOGs
|
Hi James
Would your recommendation be to follow the HL7 XML initiatives?
Regards
Doug
|
A Question Abot DIALOGs
|
Doug,
>>> My only point would be that automatic scatter gather means that the UI layer has to be aware of the fieldnames used by the data layer.
>> They are.
>But it would be preferable if they didn't need to be.
Why? I take the opposite position. If they are aware of the fields, then there is MUCH less coding required-in fact for the gather/scatter there is no coding required. Even if you don't wish to use this feature, why would it be a negative?
>> I suggest thinking about making reports in XML in the sense that it stores the data for retrieval and uses a separate format file to generate the onscreen or printed report. This is what I am doing with the Operative Report I am currently working on. There are already semi-standards for many medical reports.
>I would love to. My problem is that a lot of the report is not generatable from my software or any other automated system, but rather is dictated by the physician and typed by the secretary. Final editing may be done by either, depending upon the physician's choice. I don't know if I can move them away from this dependance on a word processor - although I would love to. Generating an xml file which is then edited using a word processor (in this case OpenOffice) is a half way solution.
They/you can input the data however you wish, but you output the report as an XML file (which can contain freeform text).
As a side note, I do remember reading an article about an semi-automated note system that was tested. Instead of freeform text being entered by the provider, they were presented with a list of items (sentences) that they could select from. They could select as many as desired and then all were included in the report. The study found that the resulting reports were more detailed than the dictated ones for two reasons. One it was faster to select items, so more items were often selected, and second, the providers were less likely to forget things since they had a list to remind them. Unfortunately, I don't have this reference in my notes.
>I would be most interested to hear how you might handle such a situation. Also how best to follow up on any proposed xml coding "standards" for such documents.
Unfortunately, there is no easy answer. I have spent hundreds of hours studying this and I still feel like I know very little.
>I do greatly appreciate the comments you are making, and the time and effort you are putting into them. I do have my own perspective on things and have come to this point via different experiences and may come across as a "difficult bastard" (to use a bit of Australian vernacular) at times. But I've always believed in robust discussion of software architecture. Sometimes people in on a design discussion I am having with a good friend of mine (we have both worked for each other at times) think we must be bitter enemies, but in fact we are good friends and at the end of the day have explored the possibilities and really understand why we have chosen the architecture we have and what to expect from it.
So far I am getting the impression that you believe in OOP, but not in inheritance, encapsulation, or polymorphism. So, I am still left with my original impression that you don't really understand OOP.
Regards,
James
|
A Question Abot DIALOGs
|
Doug,
>Would your recommendation be to follow the HL7 XML initiatives?
Probably. When I started my project more than a year ago, the only information about Operative Reports in XML that I could find was here: <!-- w --><a class="postlink" href="http://www.openhealth.org">www.openhealth.org</a><!-- w -->. They are an open source health record organization. HL7 would probably be a better standard to follow, because I am sure all the larger health organizations are going to use that one.
I don't know which report, or reports, you are working on, but here is a link to the samples that Open Health has:
<!-- w --><a class="postlink" href="http://www.openhealth.org/ASTM">www.openhealth.org/ASTM</a><!-- w -->
For the HL7 specification for a clinical document go here:
<!-- m --><a class="postlink" href="http://healthinfo.med.dal.ca/hl7intro/CDA_R2_normativewebedition/infrastructure/cda/cda.htm#CDA_Overview">http://healthinfo.med.dal.ca/hl7intro/C ... A_Overview</a><!-- m -->
This will probably put you to sleep, so start reading it just before bedtime.
Regards,
James
|
A Question Abot DIALOGs
|
Doug,
I found the link to the list-based operative report.
<!-- m --><a class="postlink" href="http://www.annalssurgicaloncology.org/cgi/content/full/11/10/941">http://www.annalssurgicaloncology.org/c ... /11/10/941</a><!-- m -->
I'm not suggesting that you try this, but it is an interesting read and good information for future consideration.
James
|
A Question Abot DIALOGs
|
Hi James
Thanks for the links - very useful
>Why? I take the opposite position. If they are aware of the fields, then there is MUCH less coding required-in fact for the gather/scatter there is no coding required. Even if you don't wish to use this feature, why would it be a negative?
Because when you want your software to link with someone else's data object you have a real issue. For a standalone application that shall forever remain standalone and where fieldnames are essentially immutable and pretty much all data is in the one persistence model it doesn't really matter but beyond that it is a major time waster and source of errors.
You may care to look at:
<!-- m --><a class="postlink" href="http://en.wikipedia.org/wiki/Three-tier_(computing">http://en.wikipedia.org/wiki/Three-tier_(computing</a><!-- m -->)
<!-- m --><a class="postlink" href="http://www.sei.cmu.edu/str/descriptions/threetier_body.html">http://www.sei.cmu.edu/str/descriptions ... _body.html</a><!-- m -->
<!-- m --><a class="postlink" href="http://msdn2.microsoft.com/en-us/library/ms685068(VS.85">http://msdn2.microsoft.com/en-us/library/ms685068(VS.85</a><!-- m -->).aspx
<!-- m --><a class="postlink" href="http://www.linuxjournal.com/article/3508">http://www.linuxjournal.com/article/3508</a><!-- m -->
<!-- m --><a class="postlink" href="http://www.oracle.com/technology/products/ias/toplink/doc/1013/MAIN/_html/undtldev010.htm">http://www.oracle.com/technology/produc ... dev010.htm</a><!-- m -->
Note: Years ago I developed a web application design / development / deployment system using three tier architecture stateless (naturally across the www) with transaction control etc. I suspect if you came with the same set of experiences your attitude to some of the issues we have been discussing might be rather different.
That's not a claim of I'm right you're wrong, but rather its a matter of having the right architecture for the future you perceive for your software and the environment(s) in which it must run and the external system(s) it must connect to. And maybe a question of a little more work now to save a lot more work later on.
Regards
Doug
|
A Question Abot DIALOGs
|
Doug,
>>Why? I take the opposite position. If they are aware of the fields, then there is MUCH less coding required-in fact for the gather/scatter there is no coding required. Even if you don't wish to use this feature, why would it be a negative?
>Because when you want your software to link with someone else's data object you have a real issue.
What is the issue?
>For a standalone application that shall forever remain standalone and where fieldnames are essentially immutable and pretty much all data is in the one persistence model it doesn't really matter but beyond that it is a major time waster and source of errors.
I don't understand why you think not having to code anything is a major time waster and source of errors?
With this system, if you later needed to map an object to different fieldnames then you could still do it. You just add different load and save methods. So I don't see any downside.
The upside is no scatter/gather coding.
No work up front, some work possible later.
I do understand three-tier systems. I did describe how you can switch to using different database sources such as ADS, XML, SQL, array, etc. as long as those tables have the same structure and fieldnames. There is still no extra programming required.
I'm not sure how any application can be completely independent of the data source. I mean you can't easily adapt to another database from another system. I you have a patient table with certain fieldnames, types and lengths, you can't easily switch to using a patient table from a different system with different fieldnames, types, and lengths. This would not be trivial task if it could even be done.
Maybe I still do not understand what you are saying.
Regards,
James
|
A Question Abot DIALOGs
|
> I'm not sure how any application can be completely independent of the data source. I mean you can't easily adapt to another database from another system. I you have a patient table with certain fieldnames, types and lengths, you can't easily switch to using a patient table from a different system with different fieldnames, types, and lengths. This would not be trivial task if it could even be done. Yo can - that's the essential message. It can be isolated to the data layer. Translation there can be made easy but you have to be careful about using inbuilt and potentially non-portable data types. That's a nice part of the xml revolution - everything as (readable) text. xBase is almost but not quite the same. Data is actually stored in readable text although we do have a small number of data types (C, D, L, N, M). I store my dates as CCYYMMDD in a character field and my own date time (CCYYMMDDhhmmsshh) - I know xHarbour has introduced its own. I do use logical memory variables but store as single character codes. Amazing how often something that is first thought to be yes / no ends up with a third possibility. It makes sense to add your own data types (stored as text) but that pretty much blows scatter/gather out of the water. But if there is an existing data object that returns data as xml then its easy to use your existing UI and BL layers with it even though data names are different.RegardsDoug(xProgrammer)
|
A Question Abot DIALOGs
|
Hello Doug,I too use text fields in my dbf files to save the values of some checkboxes:dbf-field is then something like: 0110001 James showed me how to use OOP and a database object to overcome this.I will share it with you. I hope this is as usefull for you as it is for me. And thanks again to James. Regards,Otto[code:172icv5q]Add seven new instance variables to your class.
I am going to make up just two for this explaination.
You will also need to override the load(), save(), and blank() methods of the parent TData class.
class TCustomer
DATA active
DATA approved
method load()
method save()
method blank()
...
endclass
You may want to initialize them in the new method:
method new() class TCustomer
::active:=.t.
::approved:=.f.
...
return self
And also in your blank() method.
method blank() class TCustomer
super:blank()
::active:=.t.
::approved:=.f.
return self
Then in your load method
method load() class TCustomer
super():load()
if substr(::ehrungjahr,1,1)="1"
::active:=.t.
else
::active:=.f.
endif
if substr(::ehrungjahr,2,1)="1"
::approved:=.t.
else
::approved:=.f.
endif
endif
return self
And in the edit () method you treat them just the same as fieldnames:
REDEFINE CHECKBOX oEhre1 VAR ::active ID 401 OF oFld:aDialogs [ 5 ]
REDEFINE CHECKBOX oEhre2 VAR ::approved ID 402 OF oFld:aDialogs [ 5 ]
Then in your save() method you convert them back to the legacy database:
method save() class TCustomer()
::ehrungjahr = stuff( ::ehrungjahr,1,1, if( ::active, "1", "0" ) )
::ehrungjahr = stuff( ::ehrungjahr,2,1, if( ::approved, "1", "0" ) )
::super():save()
return self
Now, converting from 1/0 to logical and back is all transparent.
You can use the new logical instance variables just as you would regular fields.
oCustomer:= TCustomer():new()
msgInfo( oCustomer:active )
oCustomer:active:=.f.
oCustomer:save()
[/code:172icv5q]
|
A Question Abot DIALOGs
|
Doug,>>> I'm not sure how any application can be completely independent of the data source.What I meant by this is not the file type source but a different application with its own data tables. Another application could have a totally different set of fields and even different tables. They may not be storing all the same data that your system is. In this situation it is next to impossible to adapt to another system without major changes to either their data structure or your application.>It makes sense to add your own data types (stored as text) but that pretty much blows scatter/gather out of the water.As Otto showed, it does not.James
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.