• Welcome to Theos PowerBasic Museum 2017.

The compiler advantage

Started by John Spikowski, August 11, 2013, 07:20:11 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

John Spikowski

If documenting include files sounds like a bad idea, how about a RapidQ to PB DDT translator?

RapidQ Windows under Wine

Frederick J. Harris

Geez John!  You're down to -1 already from the reset!

John Spikowski

#92
Can you feel the love?  :-*

Never mind. FreeQ is able to generate Rapid-Q and FreeBASIC source code. Maybe it would be worth someone's time to tweak the source to generate PowerBASIC code.

Rapid-Q




'
' <Program Name>
'
$APPTYPE GUI
$TYPECHECK ON

$INCLUDE <Rapidq2.inc>

CREATE Form1 AS QFORM
    Caption = "Main Form"
    Center
    CREATE Label1 AS QLABEL
        Left = 30
        Top = 33
        Width = 50
        Caption = "Software"
    END CREATE
    CREATE Edit1 AS QEDIT
        Left = 97
        Top = 34
        Width = 172
    END CREATE
    CREATE Butn1 AS QBUTTON
        Left = 122
        Top = 133
        Caption = "Download"
    END CREATE
END CREATE

SetWindowLong(Form1.Handle, GWL_HWNDPARENT, 0)
SetWindowLong(Application.Handle, GWL_HWNDPARENT, Form1.Handle)

Form1.ShowModal


FreeBASIC




'-------------------------------------------------------------------------------
' FreeBasic code generated by RapidFRM v1.84
'-------------------------------------------------------------------------------
#INCLUDE "windows.bi"
#INCLUDE "win/commctrl.bi"
InitCommonControls()

#DEFINE __QEDIT
#INCLUDE ONCE "win/richedit.bi"
#INCLUDE "C:/FreeQ/tools/RQInclude.bi"

'-------------------------------------------------------------------------------
' Global data from Form designer sheet
'-------------------------------------------------------------------------------
DIM SHARED AS QFORM Form1
DIM SHARED AS QFORM PTR lpForm1 = @Form1
DIM SHARED AS QLABEL Label1
DIM SHARED AS QLABEL PTR lpLabel1 = @Label1
DIM SHARED AS QEDIT Edit1
DIM SHARED AS QEDIT PTR lpEdit1 = @Edit1
DIM SHARED AS QBUTTON Butn1
DIM SHARED AS QBUTTON PTR lpButn1 = @Butn1

'-------------------------------------------------------------------------------
' Forward declarations for component events
'-------------------------------------------------------------------------------

'-------------------------------------------------------------------------------
' Configure components
'-------------------------------------------------------------------------------
SUB ConfigureComponents

    lpForm1->ObjIndex = 0
    lpForm1->Caption = "Main Form"

    lpLabel1->ObjIndex = 1
    lpLabel1->Left = 30
    lpLabel1->Top = 33
    lpLabel1->Width = 50
    lpLabel1->Caption = "Software"

    lpEdit1->ObjIndex = 2
    lpEdit1->Left = 97
    lpEdit1->Top = 34
    lpEdit1->Width = 172

    lpButn1->ObjIndex = 3
    lpButn1->Left = 122
    lpButn1->Top = 133
    lpButn1->Caption = "Download"

END SUB

'-------------------------------------------------------------------------------
' Create components
'-------------------------------------------------------------------------------
SUB CreateMainMenu
END SUB

SUB CreatePopupMenus
END SUB

SUB CreateComponents
DIM AS UINT StdStyle, ExtStyle=0
DIM AS string ObjCaption

    lpForm1->PreSetConfig()
    StdStyle=lpForm1->objStyle
    IF lpForm1->BorderStyle > bsDialog THEN ExtStyle=WS_EX_TOOLWINDOW

    lpForm1->Handle = CreateWindowEx(ExtStyle, "RQClass", lpForm1->Caption, StdStyle, _
                    lpForm1->Left, lpForm1->Top, lpForm1->Width, lpForm1->Height, _
                    0, 0, Application.hInstance, 0)
    Application.hMainForm = lpForm1->Handle
    lpForm1->PostConfig()

    lpLabel1->PreSetConfig()
    ObjCaption=lpLabel1->Caption
    StdStyle=lpLabel1->objStyle
    IF lpLabel1->Visible THEN StdStyle OR= WS_VISIBLE
    ExtStyle=0

    lpLabel1->Handle=CreateWindowEx(ExtStyle,lpLabel1->objClass, ObjCaption, WS_CHILD OR StdStyle, _
                    lpLabel1->Left, lpLabel1->Top, lpLabel1->Width, lpLabel1->Height, _
                    lpForm1->Handle, CAST(HMENU, lpLabel1->objIndex), 0, 0)

    lpLabel1->Parent = lpForm1->Handle
    lpLabel1->PostConfig()
    EnableWindow(lpLabel1->Handle, lpLabel1->Enabled)

    lpEdit1->PreSetConfig()
    ObjCaption=""
    StdStyle=lpEdit1->objStyle
    IF lpEdit1->Visible THEN StdStyle OR= WS_VISIBLE
    IF lpEdit1->BorderStyle=bsNone THEN ExtStyle=0 ELSE ExtStyle=WS_EX_CLIENTEDGE

    lpEdit1->Handle=CreateWindowEx(ExtStyle,lpEdit1->objClass, ObjCaption, WS_CHILD OR StdStyle, _
                    lpEdit1->Left, lpEdit1->Top, lpEdit1->Width, lpEdit1->Height, _
                    lpForm1->Handle, CAST(HMENU, lpEdit1->objIndex), 0, 0)

    lpEdit1->Parent = lpForm1->Handle
    lpEdit1->PostConfig()
    EnableWindow(lpEdit1->Handle, lpEdit1->Enabled)

    lpButn1->PreSetConfig()
    ObjCaption=lpButn1->Caption
    StdStyle=lpButn1->objStyle
    IF lpButn1->Visible THEN StdStyle OR= WS_VISIBLE
    ExtStyle=0

    lpButn1->Handle=CreateWindowEx(ExtStyle,lpButn1->objClass, ObjCaption, WS_CHILD OR StdStyle, _
                    lpButn1->Left, lpButn1->Top, lpButn1->Width, lpButn1->Height, _
                    lpForm1->Handle, CAST(HMENU, lpButn1->objIndex), 0, 0)

    lpButn1->Parent = lpForm1->Handle
    lpButn1->PostConfig()
    EnableWindow(lpButn1->Handle, lpButn1->Enabled)

    CreateMainMenu()
    CreatePopupMenus()
END SUB

'-------------------------------------------------------------------------------
' Remove Timers on Exit
'-------------------------------------------------------------------------------
SUB KillAllTimers
    KillTimer(Application.hMainForm, SYS_TIMER_IDX)
END SUB

'-------------------------------------------------------------------------------
' System timer - Display hints
'-------------------------------------------------------------------------------
SUB SysDisplayHint(Parent AS HWND, HintString AS string)
DIM AS TOOLINFO ti

    ti.cbSize=sizeof(ti)
    ti.uFlags=TTF_SUBCLASS: ti.hwnd=Parent
    ti.hinst=NULL: ti.lpszText=STRPTR(HintString)
    GetClientRect(Parent, @ti.rect)
    SendMessage(Application.hWndTTip, TTM_ADDTOOL, 0, CAST(LPARAM, @ti))
END SUB

SUB CheckSystemTimers
STATIC AS HWND TT_LastHWND
DIM AS HWND TT_hWnd
DIM AS Point TT_pnt

    TT_pnt.X=Screen.MouseX: TT_pnt.Y=Screen.MouseY
    TT_hWnd=WindowFromPoint(TT_pnt)
    IF TT_LastHWND<>TT_hWnd THEN
        TT_LastHWND=TT_hWnd
        SELECT CASE TT_hWnd
            CASE lpForm1->Handle
                IF lpForm1->ShowHint THEN
                    SysDisplayHint(lpForm1->Handle, lpForm1->Hint)
                END IF
            CASE lpLabel1->Handle
                IF lpLabel1->ShowHint THEN
                    SysDisplayHint(lpLabel1->Handle, lpLabel1->Hint)
                END IF
            CASE lpEdit1->Handle
                IF lpEdit1->ShowHint THEN
                    SysDisplayHint(lpEdit1->Handle, lpEdit1->Hint)
                END IF
            CASE lpButn1->Handle
                IF lpButn1->ShowHint THEN
                    SysDisplayHint(lpButn1->Handle, lpButn1->Hint)
                END IF
        END SELECT
    END IF
END SUB

'-------------------------------------------------------------------------------
' Start of Main WndProc code
'-------------------------------------------------------------------------------

SUB CheckWmTimers(hWnd AS HWND, wMsg AS UINT, wParam AS WPARAM, lParam AS LPARAM)
    SELECT CASE wParam
        CASE App_Timer.ObjIndex:  CheckSystemTimers
    END SELECT
END SUB

SUB CheckWmCommandMsg(wParam AS WPARAM, lParam AS LPARAM)
    SELECT CASE LOWORD(wParam)
        CASE lpLabel1->ObjIndex
            IF lpLabel1->OnClick>0 THEN lpLabel1->OnClick(lpLabel1)
        CASE lpEdit1->ObjIndex
            IF lpEdit1->OnChange>0 THEN lpEdit1->OnChange(lpEdit1)
        CASE lpButn1->ObjIndex
            IF lpButn1->OnClick>0 THEN lpButn1->OnClick(lpButn1)
    END SELECT
END SUB

SUB CheckWmNotifyMsg(wParam AS WPARAM, lParam AS LPARAM)
END SUB

SUB CheckWmPaintMsg(hWnd AS HWND, wMsg AS UINT, wParam AS WPARAM, lParam AS LPARAM)
    IF lpForm1->OnPaint>0 THEN lpForm1->OnPaint(lpForm1)
END SUB

FUNCTION CheckBtnColor(wParam AS WPARAM, lParam AS LPARAM) AS LRESULT
DIM AS HBRUSH hBrush=NULL
' Only for OwnerDraw buttons
    RETURN CAST(LRESULT, hBrush)
END FUNCTION

FUNCTION CheckStaticColor(wParam AS WPARAM, lParam AS LPARAM) AS LRESULT
DIM AS HBRUSH hBrush=NULL
DIM AS HDC hDC=CAST(HDC, wParam)
DIM AS HWND Handle=CAST(HWND, lParam)

    SELECT CASE Handle
        CASE lpLabel1->Handle
            SetBKMode(hDC, 1)
            SetTextColor(hDC, CAST(COLORREF, lpLabel1->Font.Color))
            hBrush=CreateSolidBrush(CAST(COLORREF, lpLabel1->Color))
    END SELECT
    RETURN CAST(LRESULT, hBrush)
END FUNCTION

FUNCTION CheckEditColor(wParam AS WPARAM, lParam AS LPARAM) AS LRESULT
DIM AS HBRUSH hBrush=NULL
DIM AS HDC hDC=CAST(HDC, wParam)
DIM AS HWND Handle=CAST(HWND, lParam)

    SELECT CASE Handle
        CASE lpEdit1->Handle
            SetBKMode(hDC, 1)
            SetTextColor(hDC, CAST(COLORREF, lpEdit1->Font.Color))
            hBrush=CreateSolidBrush(CAST(COLORREF, lpEdit1->Color))
    END SELECT
    RETURN CAST(LRESULT, hBrush)
END FUNCTION

FUNCTION CheckListBoxColor(wParam AS WPARAM, lParam AS LPARAM) AS LRESULT
DIM AS HBRUSH hBrush=NULL
    RETURN CAST(LRESULT, hBrush)
END FUNCTION

SUB CheckWmObjScroll(hWnd AS HWND, wMsg AS UINT, wParam AS WPARAM, lParam AS LPARAM)
END SUB

SUB CheckSocketEvent(hWnd AS HWND, wMsg AS UINT, wParam AS WPARAM, lParam AS LPARAM)
END SUB

' Hook into the Popup menus for all of your components here
SUB CheckWmContextMenu(hWnd AS HWND, wMsg AS UINT, wParam AS WPARAM, lParam AS LPARAM)
END SUB

SUB CheckWmHitTest(hWnd AS HWND, wMsg AS UINT, wParam AS WPARAM, lParam AS LPARAM)
END SUB

SUB CheckWmDrawItem(wParam AS WPARAM, lParam AS LPARAM)
END SUB

FUNCTION MainWndProc(hWnd AS HWND, wMsg AS UINT, wParam AS WPARAM, lParam AS LPARAM) AS LRESULT
STATIC AS integer Sizing
   
    SELECT CASE wMsg
        CASE WM_CREATE
            Sizing=False

        CASE WM_COMMAND
            IF lParam<>0 THEN
                CheckWmCommandMsg(wParam, lParam)
            ELSE
                ' IF HIWORD(wParam)=0 THEN
                '     Menu message code goes here.....
                ' ELSE
                '     Accelerator message code goes here...
                ' END IF
            END IF

        CASE WM_NOTIFY
            CheckWmNotifyMsg(wParam, lParam)

        CASE WM_PAINT
            CheckWmPaintMsg(hWnd, wMsg, wParam, lParam)

        CASE WM_TIMER
            CheckWmTimers(hWnd, wMsg, wParam, lParam)

        CASE WM_NCHITTEST
            CheckWmHitTest(hWnd, wMsg, wParam, lParam)

        CASE WM_HSCROLL, WM_VSCROLL
            IF lParam<>0 THEN CheckWmObjScroll(hWnd, wMsg, wParam, lParam)

        CASE WM_CTLCOLORBTN
            RETURN CheckBtnColor(wParam, lParam)

        CASE WM_CTLCOLOREDIT
            RETURN CheckEditColor(wParam, lParam)

        CASE WM_CTLCOLORSTATIC
            RETURN CheckStaticColor(wParam, lParam)

        CASE WM_CTLCOLORLISTBOX
            RETURN CheckListBoxColor(wParam, lParam)

        CASE WM_DRAWITEM
            CheckWmDrawItem(wParam, lParam)

        CASE WM_CONTEXTMENU
            CheckWmContextMenu(hWnd, wMsg, wParam, lParam)

        CASE WM_SOCK_NOTIFY
            CheckSocketEvent(hWnd, wMsg, wParam, lParam)

        CASE WM_MOUSEMOVE
            IF lpForm1->Cursor<>crDefault THEN
                DIM AS HCURSOR oldCursor=SetCursor(lpForm1->hCursor)
            END IF
            IF lpForm1->OnMouseMove>0 THEN
                lpForm1->OnMouseMove(LOWORD(lParam), HIWORD(lParam), 0, lpForm1)
            END IF

        CASE WM_LBUTTONDBLCLK
            IF lpForm1->OnClick>0 THEN lpForm1->OnClick(lpForm1)

        CASE WM_LBUTTONDOWN
            IF lpForm1->OnMouseDown>0 THEN
                lpForm1->OnMouseDown(MK_LBUTTON, LOWORD(lParam), HIWORD(lParam), 0, lpForm1)
            END IF

        CASE WM_LBUTTONUP
            IF lpForm1->OnMouseUp>0 THEN
                lpForm1->OnMouseUp(MK_LBUTTON, LOWORD(lParam), HIWORD(lParam), 0, lpForm1)
            END IF
            IF lpForm1->OnClick>0 THEN lpForm1->OnClick(lpForm1)

        CASE WM_RBUTTONDOWN
            IF lpForm1->OnMouseDown>0 THEN
                lpForm1->OnMouseDown(MK_RBUTTON, LOWORD(lParam), HIWORD(lParam), 0, lpForm1)
            END IF

        CASE WM_RBUTTONUP
            IF lpForm1->OnMouseUp>0 THEN
                lpForm1->OnMouseUp(MK_RBUTTON, LOWORD(lParam), HIWORD(lParam), 0, lpForm1)
            END IF

        CASE WM_KEYDOWN
            IF lpForm1->OnKeyDown>0 THEN lpForm1->OnKeyDown(LOWORD(wParam), 0, lpForm1)

        CASE WM_KEYUP
            IF lpForm1->OnKeyUp>0 THEN lpForm1->OnKeyUp(LOWORD(wParam), 0, lpForm1)

        CASE WM_CHAR
            IF lpForm1->OnKeyPress>0 THEN lpForm1->OnKeyPress(LOBYTE(wParam), lpForm1)

        CASE WM_SYSCOMMAND
            IF (wParam AND &hfff0) = SC_CLOSE THEN
                DIM AS integer Action=1                                      ' Default Action is quit
                IF lpForm1->OnClose>0 THEN lpForm1->OnClose(Action, lpForm1) ' Action passed by reference so
                IF Action=0 THEN RETURN 0                                    ' user can change default action
            END IF

        CASE WM_ENTERSIZEMOVE
            Sizing=True

        CASE WM_EXITSIZEMOVE
            lpForm1->FormReSize()
            Sizing=False
            IF lpForm1->OnResize>0 THEN
                lpForm1->OnResize(lpForm1)
                InvalidateRect(hWnd, NULL, True)
                RETURN 0
            END IF

        CASE WM_SIZE
            IF Sizing THEN RETURN 0
            IF (wParam=SIZE_MAXIMIZED) OR (wParam=SIZE_RESTORED) THEN
                IF wParam=SIZE_MAXIMIZED THEN
                    lpForm1->WindowState=wsMaximized
                ELSE
                    lpForm1->WindowState=wsNormal
                END IF
                lpForm1->FormReSize()
                IF lpForm1->OnResize>0 THEN
                    lpForm1->OnResize(lpForm1)
                    RETURN 0
                END IF
            END IF

        CASE WM_CLOSE

        CASE WM_DESTROY
            KillAllTimers()
            PostQuitMessage(0)

    END SELECT

    RETURN DefWindowProc(hWnd, wMsg, wParam, lParam)
END FUNCTION

'-------------------------------------------------------------------------------
' Create new window class for project
'-------------------------------------------------------------------------------
FUNCTION CreateWindClass(hInst AS HINSTANCE) AS integer
DIM AS WNDCLASSEX wc

WITH wc
    .cbSize = SizeOf(WNDCLASSEX)
    .style = CS_HREDRAW OR CS_VREDRAW
    .lpfnWndProc = @MainWndProc
    .hInstance = hInst
    .hIcon = LoadIcon(0, IDI_APPLICATION)
    .hCursor = LoadCursor(0, IDC_ARROW)
    .hbrBackground = GetSysColorBrush(COLOR_BTNFACE)
    .lpszClassName = @"RQClass"
    .hIconSm = .hIcon
END WITH

    RETURN RegisterClassEx(@wc)
END FUNCTION

'-------------------------------------------------------------------------------
' Main startup code
'-------------------------------------------------------------------------------
FUNCTION WinMain(hInst AS HINSTANCE, hPrevInstance AS HINSTANCE, _
                            szCmdLine AS string, iCmdShow AS integer) AS integer
DIM AS integer Result=0

    IF CreateWindClass(hInst) = 0 THEN
        ShowMessage("Register class error")
        RETURN 0
    END IF

    ConfigureComponents()
    CreateComponents()
    InitSystemTimers(lpForm1->Handle)
    HookTheMouse()

    lpForm1->Center                         ' You may wish to delete this line

    IF lpForm1->OnShow>0 THEN lpForm1->OnShow(lpForm1)

    Result = lpForm1->ShowModal             ' Show form & call default message handler

    ' You may want to change the above line to lpForm1->Show, and then provide
    ' your own function that, amongst other things, handles all window messages.

    UnHookTheMouse()

    RETURN Result
END FUNCTION

'-------------------------------------------------------------------------------
' *** MAIN ENTRY POINT ***
'-------------------------------------------------------------------------------
END WinMain(Application.hInstance, NULL, Command(0), SW_NORMAL)


'-------------------------------------------------------------------------------
' Code for the component events
'-------------------------------------------------------------------------------

Brice Manuel

Quote from: José Roca on August 21, 2013, 06:11:13 PMThere is no choice. In these times of high resolution screens, it is frustrating to see programs that are not High DPI aware and graphic applications that use the obsolete GDI. My headers provide support for DirectX, Direct2D, DirectWrite, Windows Image Component, etc., but only Patrice has tried it.

I have used your headers.  But the problem with Direct2D and DirectWrite is DirectX itself.  DirectX is a minefield on Windows due to the lack of proper support and compatibility issues.  Most Vista and 7 systems sold did NOT properly support the operating system they shipped with.  Most Vista systems were reduced to using 10Level9 to pull of the graphical effects.  7 was still down converting to 9 or 10 for many systems due to compatibility issues.  It wasn't until around the time that 7 SP1 hit that Intel based systems finally had an inbuilt GPU that would properly handle DX11 which is what 7 is supposed to have.  Systems shipping with Windows 8 are better in this regards, unfortunately, nobody is buying them.

Unless you are using the industry standard which is OpenGL which simply just works and is highly compatible, if you want something that just works on Windows and does not suffer compatibility issues, you have no choice but to use GDI or GDI+ in some cases (which is in itself old).  Everything started moving towards being hardware accelerated with Vista.  With 8, virtually everything is now hardware accelerated.  If you are using GDI on 8, it is now fully hardware accelerated just as newer APIs like D2D are.

Brice Manuel

Quote from: John Spikowski on August 22, 2013, 07:47:42 PM
I'm wondering if it is possible / practical to create a Doxygen version of José's include files.

It would depend on what license MS released their code under, as Jose converted MS's C++ headers to PB, IIRC.  Jose can't impose new restrictions on code that belongs to somebody else that he merely modified.

Brice Manuel

Quote from: John Spikowski on August 23, 2013, 01:11:25 AM
Can you feel the love?  :-*

Never mind. FreeQ is able to generate Rapid-Q and FreeBASIC source code. Maybe it would be worth someone's time to tweak the source to generate PowerBASIC code.


People are still using RapidQ?  Egads!  ???

Brice Manuel

Quote from: John Spikowski on August 22, 2013, 12:16:23 AM
QuoteDosBox version is  precompiled v0.74.

That is same pre-compiled version I started off with. (see early posts to AllBasic) If that's what your running, you really need to try my native compiled version.

Old pre-compiled version of DOSBox




DOSBox is the only thing I miss on my Kindle Fire.

John Spikowski

QuotePeople are still using RapidQ?  Egads!

Not me. I use IUP with ScriptBasic and DLLC for my Windows development. I don't normally use fixed position placement and use the natural sizing and alignment features IUP offers. I'm posting this example to show that IUP can do direct placement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,3,3,3,3,3,3,3,3,3,3,3,3,3,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2
,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2
"""

FUNCTION create_mat
  mat = dllcall(IupMatrix, "")
  dllcall(IupSetAttribute, mat, "NUMCOL", "1")
  dllcall(IupSetAttribute, mat, "NUMLIN", "3")
  dllcall(IupSetAttribute, mat, "NUMCOL_VISIBLE", "1")
  dllcall(IupSetAttribute, mat, "NUMLIN_VISIBLE", "3")
  dllcall(IupSetAttribute, mat, "EXPAND", "NO")
  dllcall(IupSetAttribute, mat, "SCROLLBAR", "NO")

  dllcall(IupSetAttribute, mat, "0:0", "Inflation")
  dllcall(IupSetAttribute, mat, "1:0", "Medicine ")
  dllcall(IupSetAttribute, mat, "2:0", "Food")
  dllcall(IupSetAttribute, mat, "3:0", "Energy")
  dllcall(IupSetAttribute, mat, "0:1", "January 2000")
  dllcall(IupSetAttribute, mat, "1:1", "5.6")
  dllcall(IupSetAttribute, mat, "2:1", "2.2")
  dllcall(IupSetAttribute, mat, "3:1", "7.2")

  dllcall(IupSetAttribute, mat, "BGCOLOR", "255 255 255")
  dllcall(IupSetAttribute, mat, "BGCOLOR1:0", "255 128 0")
  dllcall(IupSetAttribute, mat, "BGCOLOR2:1", "255 128 0")
  dllcall(IupSetAttribute, mat, "FGCOLOR2:0", "255 0 128")
  dllcall(IupSetAttribute, mat, "FGCOLOR1:1", "255 0 128")

  dllcall(IupSetAttribute, mat, "CX", "600")
  dllcall(IupSetAttribute, mat, "CY", "250")

  create_mat = mat

END FUNCTION

FUNCTION createtree
  tree = dllcall(IupTree)
  dllcall(IupSetAttributes, tree, "FONT=COURIER_NORMAL_10, " & _
                         "NAME=Figures, " & _
                         "ADDBRANCH=3D, " & _
                         "ADDBRANCH=2D, " & _
                         "ADDLEAF1=trapeze, " & _
                         "ADDBRANCH1=parallelogram, " & _
                         "ADDLEAF2=diamond, " & _
                         "ADDLEAF2=square, " & _
                         "ADDBRANCH4=triangle, " & _
                         "ADDLEAF5=scalenus, " & _
                         "ADDLEAF5=isosceles, " & _
                         "ADDLEAF5=equilateral, " & _
                         "RASTERSIZE=180x180, " & _
                         "VALUE=6, " & _
                         "CTRL=ON, " & _
                         "SHIFT=ON, " & _
                         "CX=600, " & _
                         "CY=10, " & _
                         "ADDEXPANDED=NO")
  createtree = tree
END FUNCTION

SUB func_1
  img_1 = dllcall(IupImage, 32, 32, SB_CreateImg(img_bits1))
  dllcall(IupSetHandle, "img1", img_1)
  dllcall(IupSetAttribute, img_1, "0", "0 0 0")
  dllcall(IupSetAttribute, img_1, "1", "BGCOLOR")
  dllcall(IupSetAttribute, img_1, "2", "255 0 0")

  img_2 = dllcall(IupImage, 32, 32, SB_CreateImg(img_bits2))
  dllcall(IupSetHandle, "img2", img_2)
  dllcall(IupSetAttribute, img_2, "0", "0 0 0")
  dllcall(IupSetAttribute, img_2, "1", "0 255 0")
  dllcall(IupSetAttribute, img_2, "2", "BGCOLOR")
  dllcall(IupSetAttribute, img_2, "3", "255 0 0")

  _frm_1 = dllcall(IupFrame, _
    dllcall(IupVbox, _
      dllcall(IupSetAttributes, dllcall(IupButton, "Button Text", ""), "CINDEX=1"), _
      dllcall(IupSetAttributes, dllcall(IupButton, "", ""), "IMAGE=img1,CINDEX=2"), _
      dllcall(IupSetAttributes, dllcall(IupButton, "", ""), "IMAGE=img1,IMPRESS=img2,CINDEX=3"),0))
  dllcall(IupSetAttribute, _frm_1, "TITLE", "IupButton")
  dllcall(IupSetAttribute, _frm_1, "CX", "10")
  dllcall(IupSetAttribute, _frm_1, "CY", "180")

  _frm_2 = dllcall(IupFrame, _
    dllcall(IupVbox, _
      dllcall(IupSetAttributes, dllcall(IupLabel, "Label Text"), "CINDEX=1"), _
      dllcall(IupSetAttributes, dllcall(IupLabel, ""), "SEPARATOR=HORIZONTAL,CINDEX=2"), _
      dllcall(IupSetAttributes, dllcall(IupLabel, ""), "IMAGE=img1,CINDEX=3"), 0))
  dllcall(IupSetAttribute, _frm_2, "TITLE", "IupLabel")
  dllcall(IupSetAttribute, _frm_2, "CX", "200")
  dllcall(IupSetAttribute, _frm_2, "CY", "250")

  _frm_3 = dllcall(IupFrame, _
    dllcall(IupVbox, _
      dllcall(IupSetAttributes, dllcall(IupToggle, "Toggle Text", ""), "VALUE=ON,CINDEX=1"), _
      dllcall(IupSetAttributes, dllcall(IupToggle, "", ""), "IMAGE=img1,IMPRESS=img2,CINDEX=2"), _
      dllcall(IupSetAttributes, dllcall(IupFrame, dllcall(IupRadio, dllcall(IupVbox, _
        dllcall(IupSetAttributes, dllcall(IupToggle, "Toggle Text", ""), "CINDEX=3"), _
        dllcall(IupSetAttributes, dllcall(IupToggle, "Toggle Text", ""), "CINDEX=4"), 0))), "TITLE=IupRadio"), 0))
  dllcall(IupSetAttribute, _frm_3, "TITLE", "IupToggle")
  dllcall(IupSetAttribute, _frm_3, "CX", "400")
  dllcall(IupSetAttribute, _frm_3, "CY", "250")

  _text_1 = dllcall(IupText, "")
  dllcall(IupSetAttribute, _text_1, "VALUE", "IupText Text")
  dllcall(IupSetAttribute, _text_1, "SIZE", "80x")
  dllcall(IupSetAttribute, _text_1, "CINDEX", "1")
  dllcall(IupSetAttribute, _text_1, "CX", "10")
  dllcall(IupSetAttribute, _text_1, "CY", "100")

  _ml_1 = dllcall(IupMultiLine, "")
  dllcall(IupSetAttribute, _ml_1, "VALUE", "IupMultiline Text\nSecond Line\nThird Line")
  dllcall(IupSetAttribute, _ml_1, "SIZE", "80x60")
  dllcall(IupSetAttribute, _ml_1, "CINDEX", "1")
  dllcall(IupSetAttribute, _ml_1, "CX", "200")
  dllcall(IupSetAttribute, _ml_1, "CY", "100")

  _list_1 = dllcall(IupList, "")
  dllcall(IupSetAttribute, _list_1, "VALUE", "1")
  dllcall(IupSetAttribute, _list_1, "1", "Item 1 Text")
  dllcall(IupSetAttribute, _list_1, "2", "Item 2 Text")
  dllcall(IupSetAttribute, _list_1, "3", "Item 3 Text")
  dllcall(IupSetAttribute, _list_1, "CINDEX", "1")
  dllcall(IupSetAttribute, _list_1, "CX", "10")
  dllcall(IupSetAttribute, _list_1, "CY", "10")

  _list_2 = dllcall(IupList, "")
  dllcall(IupSetAttribute, _list_2, "DROPDOWN", "YES")
  dllcall(IupSetAttribute, _list_2, "VALUE", "2")
  dllcall(IupSetAttribute, _list_2, "1", "Item 1 Text")
  dllcall(IupSetAttribute, _list_2, "2", "Item 2 Text")
  dllcall(IupSetAttribute, _list_2, "3", "Item 3 Text")
  dllcall(IupSetAttribute, _list_2, "CINDEX", "2")
  dllcall(IupSetAttribute, _list_2, "CX", "200")
  dllcall(IupSetAttribute, _list_2, "CY", "10")

  _list_3 = dllcall(IupList, "")
  dllcall(IupSetAttribute, _list_3, "EDITBOX", "YES")
  dllcall(IupSetAttribute, _list_3, "VALUE", "3")
  dllcall(IupSetAttribute, _list_3, "1", "Item 1 Text")
  dllcall(IupSetAttribute, _list_3, "2", "Item 2 Text")
  dllcall(IupSetAttribute, _list_3, "3", "Item 3 Text")
  dllcall(IupSetAttribute, _list_3, "CINDEX", "3")
  dllcall(IupSetAttribute, _list_3, "CX", "400")
  dllcall(IupSetAttribute, _list_3, "CY", "10")

  _cnv_1 = dllcall(IupCanvas, "")
  dllcall(IupSetAttribute, _cnv_1, "RASTERSIZE", "100x100")
  dllcall(IupSetAttribute, _cnv_1, "POSX", "0")
  dllcall(IupSetAttribute, _cnv_1, "POSY", "0")
  dllcall(IupSetAttribute, _cnv_1, "BGCOLOR", "128 255 0")
  dllcall(IupSetAttribute, _cnv_1, "CX", "400")
  dllcall(IupSetAttribute, _cnv_1, "CY", "150")

  _ctrl_1 = dllcall(IupVal, "")
  dllcall(IupSetAttribute, _ctrl_1, "CX", "600")
  dllcall(IupSetAttribute, _ctrl_1, "CY", "200")

  _cbox = dllcall(IupCbox, _
                  _text_1, _
                    _ml_1, _
                  _list_1, _
                  _list_2, _
                  _list_3, _
                   _cnv_1, _
                  _ctrl_1, _
             createtree(), _
             create_mat(), _
                   _frm_1, _
                   _frm_2, _
                   _frm_3, _
                        0)
  dllcall(IupSetAttribute, _cbox, "SIZE", "480x200")

  hbox = dllcall(IupSetAttributes, dllcall(IupHbox, _cbox, 0), "MARGIN=10x10")

  dlg = dllcall(IupDialog, hbox)
  dllcall(IupSetHandle, "dlg", dlg)
  dllcall(IupSetAttribute, dlg, "TITLE", "Cbox Test")
END SUB


FUNCTION main(pProg)
  dllcall(IupOpen, 0, 0)
  dllcall(IupControlsOpen)
  func_1()
  dllcall(IupShowXY, dllcall(IupGetHandle, "dlg"), IUP_CENTER, IUP_CENTER)
  dllcall(IupMainLoop)
  dllcall(IupClose)
  main = TRUE
END FUNCTION


ScriptBasic and IUP under Ubuntu 64 bit.



John Spikowski

#98
QuoteDOSBox is the only thing I miss on my Kindle Fire.

Are you saying Kindle won't allow off market apps or the Kindle doesn't have what it takes to run DOSBox?


@Brice - Since we are both known for our negative karma on this forum, lets solve this with the buddy system. I will keep your karma at zero and you do the same for me. If we get lucky José will disable the karma feature and members will actually have to post their opinions or gripes rather than the simple click of the (stone throwing) smite button.

Brice Manuel

Quote from: John Spikowski on August 23, 2013, 09:47:37 AM
Are you saying Kindle won't allow off market apps or the Kindle doesn't have what it takes to run DOSBox?

There is a way to side load apps without jail breaking it, but it does not always work.  I bought a Fire because I love Amazon and I have bought many apps and games for the Kindle Fire, and I trust Amazon with credit card info.  I could never go straight android as I will NOT order any apps via Google's service as I could never trust them with my credit card info.  Unfortunately, some things like emulators for old systems and such that I would like to purchase, are only available for purchase via Google's service and they can't be installed on a Fire without jail breaking it.  There is not a SD slot though, so you are fairly limited with space as I have a first generation Fire.


Quote from: John Spikowski on August 23, 2013, 09:47:37 AM@Brice - Since we are both known for our negative karma on this forum, lets solve this with the buddy system. I will keep your karma at zero and you do the same for me. If we get lucky José will disable the karma feature and members will actually have to post their opinions or gripes rather than the simple click of the (stone throwing) smite button.

The irony is leaving negative karma for somebody, is in itself an act of bad karma.  Unlike most forums where the people leaving the karma are identified in your profile, here they are allowed to hide their identity and be cowardly.  The idea of a karma system on any forum is laughable as it speaks to the frailty of the human ego where people perceive somebody having thoughts they do not agree with as something that should be punished.  Thought crimes are very Orwellian and speak to the wider social issues this world is facing.

Patrice Terrier

What made this forum a valuable place, was the quality of the contributions posted here.

I don't see any useful contributions in this thread for those that are accustomed to the usual José Roca's forum topics.

I never considered free exotics as a viable alternative to the professionnal tools i am using.
I like to have full control on my code and i avoid like the plague extra level of encapsulations. There is only one exception to my moto: WinDev, because it is a tool of exception to build quickly modern looking applications, using hundreds of windows.

...
Patrice Terrier
GDImage (advanced graphic addon)
http://www.zapsolution.com

Brice Manuel

Quote from: Patrice Terrier on August 23, 2013, 02:54:16 PM
I don't see any useful contributions in this thread for those that are accustomed to the usual José Roca's forum topics.

Your posts would be a perfect example as they are often promoting WinDev or C++.  Luckily this is the General Discussion category, so it it is not limited to contributions.

Technically, there is no place to make contributions here, as the forums for contributions are labeled for Jose, Patrice, Fred, Theo, Charles.  Unless you are one of those people, there is not a specific place for somebody to make a code contribution, tutorials, etc.  There is only a place for third-party add-ons, nothing else.  People might contribute if there was a way, and a place, for them to actually contribute.

Chris Holbrook

Quote from: Brice Manuel on August 23, 2013, 10:31:35 AMThe irony is leaving negative karma for somebody, is in itself an act of bad karma.
Agreed. You can make a better case for +ve, for example, to indicate approval when to post a message would add nothing more.

Patrice Terrier

Brice

You can create a new thread named "Contributions" inside "General Discussion", this is the way i started, before José gave me the status of moderator, and allowed me to create my own section.

By the way, i think the number of people reading a specific thread is also a good indicator of popularity, but you can never know if it is an indicator of good or bad karma until you read it yourself ;)

...
Patrice Terrier
GDImage (advanced graphic addon)
http://www.zapsolution.com

John Spikowski

#104
QuoteI don't see any useful contributions in this thread for those that are accustomed to the usual José Roca's forum topics.

Define useful contributions. That's like saying I'm having a bad day and walk away. I think this thread has been very enlightening.


  • José has come out and declared his position with COM/PB and his disappointment in the PB community not taking advantage of the tools he and Bob spent years creating.
  • My stroll down Android alley and what can be done off main street.
  • There is life beyond PowerBASIC.
  • Everyone needs someone to blame.
  • Realizing that people buy/use a BASIC language because they don't want to learn Java or C. Trying to turn PB (QB on steroids) in to a PB.net framework done right is a dream that should have become a reality more than 10 years ago.
  • I like hearing about the real life adventures of the guys I've known (via forums) for years and the stuff they do outside the PB realm.
QuoteMicrosoft CEO Steve Ballmer has announced his intentions to step down.

Best news I have heard coming out of the M$ camp in years.