Oxygen Basic

Information => Open Forum => Topic started by: Frankolinox on February 04, 2013, 02:25:14 AM

Title: oxygen light (ddt modus)?
Post by: Frankolinox on February 04, 2013, 02:25:14 AM
hi charles, hi all other oxygen friends. yesterday I was asking myself if that's not possible to make an alternative "oxygen basic light"  version for gui's and callbacks and buttons (like "ddt" modus on powerbasic) and so on... I don't know how to make it, but perhaps it's an idea to make oxygen more attractive and simplifier for usual programmers or other basic language users here at the board.

best regards, frank
Title: Re: oxygen light (ddt modus)?
Post by: Peter on February 04, 2013, 06:14:04 AM
Hi Frank,

May I ask, what is OxygenBasic light?
Is it a lack of understanding of the Windows API?
Or a lack of creativity of the people  to dealing with OxygenBasic?
Title: Re: oxygen light (ddt modus)?
Post by: Aurel on February 04, 2013, 07:25:10 AM
Quote
Is it a lack of understanding of the Windows API?
Or a lack of creativity of the people  to dealing with OxygenBasic?

In my case little bit from first & little bit from second... ::)
Title: Re: oxygen light (ddt modus)?
Post by: Peter on February 04, 2013, 08:06:53 AM
Quote
In my case little bit from first & little bit from second...


I love truth.  :D
Title: Re: oxygen light (ddt modus)?
Post by: Peter on February 04, 2013, 08:33:47 AM
Hi,

This demo shows the simplicity of OxygenBasic.
The song is called: through the light.


X
Title: Re: oxygen light (ddt modus)?
Post by: Haim on February 04, 2013, 09:28:14 PM
Nice demo, but where do I see the simplicity...
It seems to be quite complex  :)
Haim
 
Title: Re: oxygen light (ddt modus)?
Post by: Charles Pegge on February 05, 2013, 03:28:59 AM
Lovely bees! How we missed them last year. We only had a few wild bees here.

For a simplified Windows API, IUP looks like a good bet. It has the advantages of being well established and cross-platform. I include our IUP stuff with Oxygen-in-progress.  folder: /ProjectsB/IUP/

I am still working on an Opengl GUI. This turns out to be a very looong project but good fun. I have concentrated on producing the edit control first, since that is the most important and most complex of all the controls. . There is now syntax highlighting, block copy and paste  projectsA/OpenglGUI.

Charles




OpenglGui
(http://www.oxygenbasic.org/o2pics/opengl/KeywordHighl.jpg)
Title: Re: oxygen light (ddt modus)?
Post by: Peter on February 05, 2013, 04:18:53 AM
I hope you will get it this year, then will come the lovely bees ! 
Title: Re: oxygen light (ddt modus)?
Post by: Peter on February 05, 2013, 04:19:42 AM
Hi Haim,

see in example section, there you will find my new "Simple Window" work.
it's really good for beginner, for other people too.

instead of a help description, i will make some demos about  every command.
i think that is easier for understanding what the command is doing.
Title: Re: oxygen light (ddt modus)?
Post by: Haim on February 05, 2013, 06:07:14 AM
Thanks for your response
I like the demos very much and already enjoy studying them
Haim
Title: Re: oxygen light (ddt modus)?
Post by: Aurel on February 05, 2013, 10:40:35 PM
What IUP ,,,you must be joking ,right Charles?
IUP is a just small wrapper and cannot be compered with full native Win32 api.
Anyone can tell me which world wide program is created by IUP... ???
OF COURSE ...if you are JRS then IUP is the HITof the year.
However -where is by the way latest inProgress download  , there is nothing
on sourceforge page ???

Oh yes may i suggest awinh.inc to build win GUI programs...
it is just a small win32 bunch of functions ..hey but work..
Title: Re: oxygen light (ddt modus)?
Post by: JRS on February 05, 2013, 11:45:13 PM
Once again you're running your mouth talking trash you know nothing about. I don't have a lifetime to write a Windows application from scratch via the SDK. This is a high level Basic forum. If low level programming is your interest, join a C or ASM forum and give us a break.

Title: Re: oxygen light (ddt modus)?
Post by: Aurel on February 06, 2013, 01:20:21 AM
Haim
You can try this simple example and then tell me ...
Is this much more familiar to you...
Code: [Select]
'gui-skeleton app
Include "awinh.inc"
#lookahead
INT win,win2
INT x,y,w,h,x2,y2,w2,h2
x=0:y=10:w=400:h=400
x2=410:y2=10:w2=400:h2=300
INT winstyle,wstyle2
winstyle = WS_MINMAXSIZE or WS_CLIPCHILDREN
wstyle2 = WS_MINMAXSIZE or WS_CLIPCHILDREN
INT b0ID = 100
'############################################

'############################################
'create window **************************************************
win = SetWindow("Skeleton App",x,y,w,h,0,winstyle)
'create button on win
button0 = SetButton(win,80,4,80,26,"Close Win2",0x50000000,0x200,b0ID)
'create second window
win2 = SetWindow("New Window",x2,y2,w2,h2,0,winstyle)
'****************************************************************

'/////////
Wait()
'\\\\\\\\\

Function WndProc (sys hwnd,wmsg,wparam,lparam) as sys callback

SELECT hwnd
'----------------------------------------
CASE win
'----------------------------------------
Select wmsg
CASE WM_CLOSE
DestroyWindow win
MsgBox "Quit...","End program!"
PostQuitMessage 0

    CASE WM_COMMAND
controlID = LoWord(wParam) 'get control ID
notifyCode = HiWord(wParam) 'get notification message

Select controlID
   CASE b0ID
If notifycode=0 
MsgBox "Close New Window!","To Win2"
         CloseWindow(win2)
End If
    End Select
End select
'----------------------------------------
CASE win2
'-----------------------------------------
Select wmsg
CASE WM_CLOSE
DestroyWindow win2
MsgBox "Win2 Closed!","WIN2"
End select

END SELECT

RETURN Default

END FUNCTION


X
Title: Re: oxygen light (ddt modus)?
Post by: Haim on February 06, 2013, 04:34:26 AM
Thanks Aurel
I will look at this over the weekend.

Haim
Title: Re: oxygen light (ddt modus)?
Post by: Peter on February 06, 2013, 05:56:50 AM
JRS,

I saw your IUP works on your side.
I like it,  it isn't bad for a man whose lifetime is very short.  :D

I think that  IUP has a privilege in the programming world.
Title: Re: oxygen light (ddt modus)?
Post by: JRS on February 06, 2013, 08:40:48 AM
Thanks Peter for your support.

IUP is stable, easy to use and has a friendly / helpful author that reminds me of Charles.

Title: Re: oxygen light (ddt modus)?
Post by: Aurel on February 06, 2013, 10:57:08 PM
Quote
I don't have a lifetime to write a Windows application from scratch via the SDK.
objection.... ;D :D

And by the way what is DDT  ??? ( sounds like old insecticid )

PS..ok i found:
http://www.oxygenbasic.org/downloads.htm
Title: Re: oxygen light (ddt modus)?
Post by: Charles Pegge on February 07, 2013, 04:11:24 AM

DDT was also a 1980s microsoft package 'Dynamic Debugging Tool' supplied with their 8086 Assembler
Title: Re: oxygen light (ddt modus)?
Post by: Peter on February 07, 2013, 06:12:24 AM
This was a question  what JRS put in  the ThinBasic Forum.

Do you know, why there is another result?
I know  because I understand the  priorities.

'Which of the poll expressions will provide a different answer?
Code: [Select]
PRINT "(1)  " + str((45 * ( 9 - 5 + 8 ) - 36 / 4))  
PRINT "(2)  " + str((45 * ( 9 - ( 5 + 8 ) ) - 36 /4))
PRINT "(3)  " + str((45 * ( 9 - 5 + 8 ) - ( 36 / 4)))
PRINT "(4)  " + str((45 * ( ( 9 - 5 ) + 8 ) - 36 / 4))

'jrs@laptop:~/sb/test$ scriba qod_01.sb
'(1) 531
'(2) -189
'(3) 531
'(4) 531
'jrs@laptop:~/sb/test$
Title: Re: oxygen light (ddt modus)?
Post by: Frankolinox on February 08, 2013, 07:44:48 AM
followed by my idea here a first attempt to make shorter the win api with button. only the winmain() function with "width" and "height" values are a problem as I cannot change values by functions. second: the window procedere I haven't changed yet.

@peter: It's not the problem for me to understand win api or oxygen, but I thougth about other programmers and newbies using oxygen basic. For my personal opinion it's better to have a better overview about my code structures and therefore I liked (for example) the short ddt modus of powerbasic for dialogs and callbacks. I know the powerful win api and sdk modus of powerbasic too and for oxygenbasic but it was just an idea to make a simple building of an dialog with button (only as example).

use at own risk. all include file you find in rar file.

Code: [Select]
 $ filename "t.exe"
  '#include "../../inc/RTL32.inc"
  '#include "../../inc/RTL64.inc"
  '#include "../../inc/MinWin.inc"
  #include "MinWin.inc"
  #include "button.inc"
  #include "mywinz.inc"

  #lookahead ' for procedures
  
  s=error()
  '
  if s then
    print s
    end
  end if

  '=========
  'MAIN CODE
  '=========
  dim as sys = inst,hwnd
  dim cmdline as asciiz ptr
  dim as rect crect 'for WndProc and TimerProc
  
  '======================================
  '// -------------------------// my idea
  inst=GetModuleHandle 0
  oxymain(inst, 0,cmdline,SW_NORMAL)
  mywinz(hwnd,320,240,"hello oxywin")
  '// -------------------------// my idea
  '======================================
  
  
  '----------- // no idea yet how to make that one shorter // ---
  '--------------------------------------------------------------
  function WndProc ( hWnd, wMsg, wParam, lparam ) as sys callback
  '==============================================================

    static as sys hdc
    static as String txt
    static as PaintStruct Paintst
 
    '==========
    select wMsg
    '==========
      case WM_COMMAND
        mbox "hello button"      
      '--------------
      case WM_CREATE
      '=============
      '--------------------------------------------- // my idea
      call btn("button","test",20,20,120,40,hwnd)
      '--------------------------------------------- // my idea
      GetClientRect  hWnd,&cRect

      '--------------  
      case WM_DESTROY
      '===============
          
      PostQuitMessage 0
        
      '------------
      case WM_PAINT
      '============


      'TEXT
      'http://msdn.microsoft.com/en-us/library/dd144821(v=VS.85).aspx

      'DRAWING AND PAINTING
      'http://msdn.microsoft.com/en-us/library/dd162760(v=VS.85).aspx

      GetClientRect  hWnd,&cRect
      hDC=BeginPaint hWnd,&Paintst
      'style
      '0x20 DT_SINGLELINE
      '0x04 DT_VCENTER
      '0x01 DT_CENTER
      '0x25

       SetBkColor   hdc,yellow
       SetTextColor hdc,red
       DrawText hDC,"Hello OxygenWorld!",-1,&cRect,0x25      
       EndPaint hWnd,&Paintst
        
      '--------------  
      case WM_KEYDOWN
      '==============

      '============            
      Select wParam
      '============

Case 27 : SendMessage hwnd, WM_CLOSE, 0, 0      'ESCAPE
      End Select      

      '--------        
      case else
      '========          
        function=DefWindowProc hWnd,wMsg,wParam,lParam
        
    end select
  end function ' WndProc


I like the iup design too, but it's working with external dll. My idea was to use only the oxygen own power basis :-)

best regards, frank

X
Title: Re: oxygen light (ddt modus)?
Post by: JRS on February 08, 2013, 08:27:00 AM
Quote
I like the iup design too, but it's working with external dll.

I assume you have written your own win32api and have static linked this custom code into your application?  ::)

@Charles - You are going to have to come up with something other than oxygen.dll as some of your users have a phobia with using DLLs.

Title: Re: oxygen light (ddt modus)?
Post by: Aurel on February 08, 2013, 08:45:08 AM
Heh ...
Why use external dll if we can build compact exe without need for dll,right?
So that's why I prefer build exe.

Frank
It is not main problem use api then problem is how wrapp wndProc and use
it somwhere else...
Title: Re: oxygen light (ddt modus)?
Post by: Peter on February 08, 2013, 09:23:33 AM
Quote
@Charles - You are going to have to come up with something other than oxygen.dll as some of your users have a phobia with using DLLs.

could I be infected?  :D
Title: Re: oxygen light (ddt modus)?
Post by: JRS on February 08, 2013, 09:55:21 AM
Quote
Heh ...
Why use external dll if we can build compact exe without need for dll,right?
So that's why I prefer build exe.

If it wasn't for the entertainment value, I would put you on ignore.

How do you think your standalone .exe programs are accessing OS services, via a static linked interface to AurelOS?
Title: Re: oxygen light (ddt modus)?
Post by: Aurel on February 08, 2013, 01:20:59 PM
About what kind of 'static linked interface' you talking... ::)
SLL is static linked library ,include file is not SLL....
AurelOS is not AurelOS then is Microsoft Windows ,right?

Sooo what is wrong if someone or most of us use alredy built in stuff in
OS which we use...NOTHING.

For you IUP have a value because you work on Linux and must use external GUI
to create GUI app, but on Windows you can use GUI api already built in. 

Infact if i must use something else i will use wxWindows,
i have tested wx with wxLua and work and look really great...
Another thing- not bad at all wrapper created by Vanya -called window9 based on PureBasic
syntax style..can be good to...
Title: Re: oxygen light (ddt modus)?
Post by: JRS on February 08, 2013, 07:44:12 PM
Quote
For you IUP have a value because you work on Linux and must use external GUI
to create GUI app, but on Windows you can use GUI api already built in.

Bring up a Ubuntu desktop Linux system from scratch. No IUP is installed but you have a full GUI and API to work with. (Gtk - or others depending on the distribution)

Do you have any toes left?