December 01, 2024, 10:21:41 AM

News:

Own IWBasic 2.x ? -----> Get your free upgrade to 3.x now.........


Old IBStandard archive

Started by DominiqueB, September 04, 2007, 03:13:54 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

DominiqueB

Hello,

for those that don't know the codingmonkeys site, Joske built a big archive of old IBStandard code.
For most of them, one just have to change the file's extension from iba to cba and let's go and compile :-)

http://www.codingmonkeys.com/index.php?topic=516.0

ps: you have to be registred on the site to be able to download the archive !

Have fun . . .

Thank's to Paul for this "new" language . . .

Dominique

Vikki

Although I haven't looked at it lately...actually for several years.... *slaps herself silly*... there is still some information at the PyxiaSAQ. Never took it down for whatever reason.  :)  I don't know for sure what is applicable to CBasic but there's stuff there to look at for old times sake if nothing else.  ;)

http://www.web-helper.net/PyxiaSAQ/

GWS

September 05, 2007, 10:33:22 AM #2 Last Edit: September 06, 2007, 11:47:05 AM by GWS
Hi Vikki  :)

I'm sure there's lots of good stuff in there.

I just picked the first item from the API section - DrawText, copied it into CBasic and away it went ..  :)

Well actually I colored the window, and placed the text rectangle in the middle of the window to make it look neater.

Why you would use it I'm not sure 'cos CBasic has pretty effective text writing facilities.  Still, the API is all-powerful ..  :)

Here's Paul's program:


' Here is an example of using DrawText.
' Sorry it's so long but I wanted to include all the SETID's in case you need to experiment.
' The only one you really need is DT_WORDBREAK. Watch for wrapping as usual.

Code:
SETID "DT_TOP",    0x00000000
SETID "DT_LEFT",   0x00000000
SETID "DT_CENTER",      0x00000001
SETID "DT_RIGHT",  0x00000002
SETID "DT_VCENTER",     0x00000004
SETID "DT_BOTTOM",      0x00000008
SETID "DT_WORDBREAK",   0x00000010
SETID "DT_SINGLELINE",  0x00000020
SETID "DT_EXPANDTABS",  0x00000040
SETID "DT_TABSTOP",     0x00000080
SETID "DT_NOCLIP",      0x00000100
SETID "DT_EXTERNALLEADING",  0x00000200
SETID "DT_CALCRECT",    0x00000400
SETID "DT_NOPREFIX",    0x00000800
SETID "DT_INTERNAL",    0x00001000
SETID "DT_EDITCONTROL", 0x00002000
SETID "DT_PATH_ELLIPSIS",    0x00004000
SETID "DT_END_ELLIPSIS",     0x00008000
SETID "DT_MODIFYSTRING",     0x00010000
SETID "DT_RTLREADING",  0x00020000
SETID "DT_WORD_ELLIPSIS",    0x00040000

TYPE WINRECT
DEF left:INT
DEF top:INT
DEF right:INT
DEF bottom:INT
ENDTYPE

DECLARE "user32",DrawTextA(hDC:INT,lpString:STRING,nCount:INT,lpRect:WINRECT,uFo rmat:INT),int
DECLARE "gdi32",SetTextAlign(hDC:INT,mode:INT)

REM example usage
DEF win:WINDOW
WINDOW win,0,0,640,400,@SIZE|@MINBOX|@MAXBOX,0,"test",mainwindow
setwindowcolor win, rgb(0,200,200)
DEF rc:WINRECT
DEF text,ret:STRING
DEF hdc:INT
DEF left,top,right,bottom:int
DEF boxwidth,boxheight:int

ret = CHR$(10) + CHR$(13)
text = "A line with some returns" + ret + "In it" + ret + "Centered for effect"

REM get the client size of the window
REM and store it in the rectangle
'GETCLIENTSIZE win,rc.left,rc.top,rc.right,rc.bottom
GETCLIENTSIZE win,left,top,right,bottom

boxwidth = 200
boxheight = 200

' center the box
rc.left = (right - left - boxwidth)/2
rc.top = (bottom - top - boxheight)/2
rc.right = rc.left + boxwidth
rc.bottom = rc.top + boxheight

REM get a handle to a device context
hdc = GETHDC(win)
REM turn off automatic text alignment
REM since DrawTextA handles it
SetTextAlign(hdc,0)

' this draws the text in the positioned box ..
DrawTextA(hdc,text,-1,rc,@DT_WORDBREAK|@DT_CENTER)

RELEASEHDC(win,hdc)

run = 1
waituntil run=0

closewindow win
end

' You can place the rectangle anywhere in the window you wish.
' I simply made it the same size as the client area.
' If you do this:
' rc.left = rc.left + 10
' rc.right = rc.right - 10

' for example you give the rectangle a 10 pixel margin on both sides.
' In the call I used @DT_CENTER. You can also use @DT_LEFT or @DT_RIGHT as well.

sub mainwindow
select @CLASS
case @IDCLOSEWINDOW
  run = 0
ENDSELECT
return





all the best,

Graham
Tomorrow may be too late ..