September 26, 2022, 06:14:47 AM

News:

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


Alpha update 12/11/2005

Started by Ionic Wind Support Team, December 11, 2005, 02:42:38 PM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

Ionic Wind Support Team

Yep that's right, another update.  Redownload and install from the link provided with yout purchase.

Changes/Additions:
--------------------------
- Partial GUI functionality.
- 'window' class added. -- See 'gui.inc' in your BIN directory
:: can be used to resolve the scope of a function - discussed earlier
!! is used to call a base class function from a derived virtual one.  As in :

window !! WndProc(message,lparam,wparam)

- The space was removed from STR$ output.
- virtual functions are now working properly
- Many parser lockups fixed
- Sample 'window1.src' added

Have to go pick up my kids....be back with more details in a while.

Ionic Wind Support Team

Parker

Yay!!  :D
Thanks a lot! I'm going to have fun with this

Zen

Woo Hoo. Now the real fun starts.

Thanks a lot Paul.

Zen

Probably me being stupid again but ive just tried to make a program with the new GUI update. I wanted to make a message box when the user click the close button but i dont know what to put as the first argument because in the class definition it doesnt actually have the class variable used to create the window (if that makes sense).

Lewis

Zen

Yes of course it was me! The missing link was "this"

Lewis

Parker

You can either use the GetHandle() method or just use the m_hWnd variable. If you remember in IBasic, we had to use window.hWnd when calling API functions. It's pretty much the same thing here.

Ionic Wind Support Team

Updated again.  Fixed the bug that lewis found ;)

Sorry to make you redownload twice in as many hours.
Ionic Wind Support Team

Zen

Thanks Paul.

Its ok i dont mind downloading again. At least its only 2mb.

Lewis

Ionic Wind Support Team

Current methods available in the window class.  Documented here for those that don't want to keep looking in "gui.inc"


//graphics
declare BackPen(unsigned int crColor);
declare Circle(int x, int y, int r, OPT unsigned int outline=0xFFFFFFFF, OPT unsigned int fill=0xFFFFFFFF);
declare DrawMode(mode as INT);
declare DrawRect(int l,int t,int w,int h,OPT unsigned int outline=0xFFFFFFFF, OPT unsigned int fill=0xFFFFFFFF);
declare Ellipse(int l,int t,int w,int h,OPT unsigned int outline=0xFFFFFFFF,OPT unsigned int fill=0xFFFFFFFF);
declare FloodFill(int x, int y, unsigned int crColor);
declare FrontPen(unsigned int crColor);
declare GetHDC(),unsigned int;
declare GetPixel(int x,int y),unsigned int;
declare GetPosition(),POINT;
declare Line(int sx,int sy,int ex,int ey,opt unsigned int clr=0xffffffffu);
declare LineTo(int ex,int ey,opt unsigned int clr=0xffffffffu);
declare Move(int x,int y);
declare ReleaseHDC(hdc as unsigned int,OPT bRedraw=1 as INT);
declare SetPixel(x as int, y as int, OPT clr=0xFFFFFFFF as unsigned int);
declare SetFont(string typeface,int height,int weight,OPT int flags=0,OPT int id=0);
declare SetLineStyle(style as INT,width as INT);
declare SetRasterOp(mode as INT);
declare SetWindowColor(clr as unsigned INT);
declare WriteText(int x,int y,string text);
//general methods
declare AddAccelerator(unsigned byte fVirt, word key, word cmd);
declare CenterWindow();
declare EnableTabs(int bEnable);
declare GetCaption(),heap;
declare GetClientRect(),RECT;
declare GetTextSize(text as STRING),POINT;
declare GetWindowRect(OPT id=0 as INT),RECT;
declare ModifyStyle(unsigned INT add,unsigned INT remove,OPT int id=0);
declare ModifyStyleEx(unsigned INT add,unsigned INT remove,OPT int id=0);
declare RedrawFrame(OPT id=0 as INT);
declare SetCaption(string text);
declare SetCursor(int type,OPT unsigned int handle=0);
declare SetFocus(OPT id = 0 as INT);
declare SetIcon(handle as unsigned INT);
declare ShowWindow(nCmdShow as INT,OPT id=0 as INT);
declare StartTimer(unsigned int time,opt int nIDEvent=1,opt unsigned int callback);
declare StopTimer(opt int nIDEvent=1);


Current message handlers overridable from the window class


//message handlers
declare virtual OnChar(unsigned int nChar,INT nRepCnt);
declare virtual OnClose(),int;
declare virtual OnCreate(),int;
declare virtual OnDestroy(),int;
declare virtual OnKeyDown(unsigned int nChar, INT nRepCnt, unsigned int nFlags),int;
declare virtual OnKeyUp(unsigned int nChar, INT nRepCnt, unsigned int nFlags),int;
declare virtual OnLButtonDown(int x,int y, int flags),int;
declare virtual OnLButtonUp(int x,int y,int flags),int;
declare virtual OnLButtonDblClk(int x,int y,int flags),int;
declare virtual OnMouseMove(int x,int y,int flags),int;
declare virtual OnPaint(),int;
declare virtual OnRButtonDown(int x,int y,int flags),int;
declare virtual OnRButtonUp(int x,int y,int flags),int;
declare virtual OnRButtonDblClk(int x,int y,int flags),int;
declare virtual OnSize(int nType,int cx,int cy),int;
declare virtual OnSizing(int nSide,RECT rc),int;
declare virtual OnTimer(int nIDEvent),int;


There will be another update this evening with more message handlers.  Override WndProc if you need to process an unhandled message before then.  Just don't forget to call the base class implimentation.

Other functions that crept into this release:


//functions
declare extern ColorRequest(window *win,OPT unsigned int initcolor=0xFFFFFF),unsigned int;
declare extern FontRequest(window win,int vSize BYREF,int vWeight BYREF,unsigned int vFlags BYREF,unsigned int vColor BYREF,OPT string name),HEAP;
declare extern MessageBox(window *win,string text,string caption,OPT unsigned int flags),int;
declare extern WAIT(OPT int nosleep=0);
declare extern RGB(int r,int g,int b),unsigned int;


FileRequest was also changed to accept a window class as the parent parameter.

Ionic Wind Support Team

Parker

Just wondering, will it be possible eventually to do this:
OnCommand(WM_NCLBUTTONUP, &MyProc);
...
sub MyProc(UINT msg, WPARAM wParam, LPARAM lParam)
{
...
}

assuming we have windows headers translated

Ionic Wind Support Team

OnCommand will be an overridable in the next update.  No need for an external function.

Ionic Wind Support Team

Ionic Wind Support Team

Also don't forget you can override WndProc now in any derived class to get ahold of any available message before it gets sent to the virtual handlers.

Paul.
Ionic Wind Support Team

Zen

Can i have an example of using the hWnd because i tried to use it to listen for a message but it froze my program ???

Lewis

Ionic Wind Support Team

??

Do you mean overriding WndProc?

Open the 'window1.src' example, uncomment the mywindow::WndProc function and the declaration in the mywindow class.


class mywindow : window
{
//overridden functions.
declare OnClose(),int;
declare OnCreate(),int;
declare OnTimer(int nIDEvent),int;
declare WndProc(unsigned int message, unsigned int wparam, unsigned int lparam),int;
}




mywindow::WndProc(unsigned int message, unsigned int wparam, unsigned int lparam),int
{

        select(message)
        {
             case WM_COMMAND:
                //do something
        }
         //call the base class
return window!!WndProc(message,wparam,lparam);
}
Ionic Wind Support Team

Zen

Yes sorry, i meant overriding it.

I dont know what i did wrong exactly but now i know how to do it.

Thanks a lot.
Lewis