Author Topic: Is there a sample oxygen code on combobox?  (Read 2294 times)

0 Members and 1 Guest are viewing this topic.

Karen Zibowski

  • Guest
Is there a sample oxygen code on combobox?
« on: March 04, 2018, 06:26:42 AM »
Hi
Is there a sample oxygen code on creating a combobox?

Aurel

  • Guest
Re: Is there a sample oxygen code on combobox?
« Reply #1 on: March 04, 2018, 08:17:51 AM »
Hmm i never finished this very useful control but for start you may try this
(little help from my old DLib api functions) - i compile this example with A041
This example shows some other controls..
use include awinh.inc from attachment

Code: [Select]
$ Filename "NewWin.exe"
Include "RTL32.inc"
Include "awinh.inc"
#lookahead ' for procedures
'Indexbase 0
'must be in global scope +++++++++++++++++++++++++
string txt = nuls 500000 'buffer
string lines[4000]   'lines array
'sys pt = strptr txt    'buffer base pointer
sys i.j,p              'indexes and pointer
string CRLF=chr(13)+chr(10)
string temp$=""
'++++++++++++++++++++++++++++++++++++++++++++++++
% LR_LOADTRANSPARENT = &H20
% LR_LOADMAP3DCOLORS = &H1000
INT TransparentMap3D = LR_LOADTRANSPARENT or LR_LOADMAP3DCOLORS
INT win,win2
INT winstyle
INT button1,button2,button3,button4,button5,combo1,comboID = 600
INT edit1,edit2,edit3
INT Lbox,static1,static2,static3,richedit1
INT ed1ID,ed2ID,ed3ID
INT b1ID,b2ID,b3ID,b4ID,b5ID,b6ID,b7ID
INT LboxID = 300
INT st1ID,st2ID
INT reID
b1ID=100
b2ID=101
b3ID=102
b4ID=103
b5ID=104
'-----------------
ed1ID=200
ed2ID=201
ed3ID=202
'----------------
st1ID=350
st2ID=351
st3ID=352
'----------------
reID=400
'loadbmp
'##########################################
INT bmpB1,bmpS1
bmpB1 = LoadImage(0,"data/xpBopen.bmp",0,76,20,16)
bmpS1 = LoadImage(0,"data/xpStatic.bmp",0,82,82,16)
'##########################################
STRING src[15000]
'*******************************************
'************* GLOBALS *********************
'*******************************************
String arg[16]
sys dPos[16]
'---array of global variables -------------
string gArrInt[100]
'*******************************************
'FOR stack--------------------------------
INT forStart,fc[100],forEnd[100]
INT fPush,fStep[100],forPos[100]
STRING fStack[16]
'-----------------------------------------
'###########################################

winstyle = WS_MINMAXSIZE or WS_CLIPCHILDREN
'create window **************************************************
win = SetWindow("Windows Controls...",100,100,640,400,0,winstyle)
'****************************************************************
'create buttons ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
button1 = SetButton(win,280,14,100,24," button 1",0x50000000,0x200,b1ID)
'set bitmap on button 1
'SendMessage button1 , BM_SETIMAGE, 0, bmpB1
button2 = SetButton(win,390,14,80,24," button 2",0x50000000,0x200,b2ID)
button3 = SetButton(win,490,14,120,24," button 3",0x50000000,0x200,b3ID)
button4 = SetButton(win,490,62,84,24," button 4",0x50000000,0x200,b4ID)
button5 = SetButton(win,490,88,84,24," button 5",0x50000000,0x200,b5ID)
beep 100,100
':::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
'create edit control.......................................................
edit1 = SetEditBox(win,100,60,380,23,"edit 1",0x50004000,0x200,ed1ID)
'create COMBOBOX #######################################################################
combo1 = SetComboBox(win, 100, 86, 150, 150," ComboBox_1", 0x50800603, 0, comboID)
'add items - strings into combobox start position is Zero -> 0
AddCBItem( combo1, 0, " CB_Item_1")
AddCBItem( combo1, 1, " CB_Item_2")
AddCBItem( combo1, 2, " CB_Item_3")
AddCBItem( combo1, 3, " CB_Item_4")
'########################################################################################
INT _hfont
'create listbox...............................................................
Lbox = SetListBox(win,10,150,180,150,"ListBox 1",0x50000140,0x200,LboxID)

'create static control
static1 = SetStatic(win,10,20,254,16," This is a STATIC text control with EX_CLIENTEDGE",0,0x200,st1ID)
'upper edit
static2 = SetEditBox(win,10,40,600,18,"edit control 2",0x50004000,0x200,st1ID)
'crete static control with bitmap
static3 = SetStatic(win,10,60,82,82,"",0x5000030E,0x200,st3ID)
SendMessage static3 ,370, 0, bmpS1

'create Rich Edit control
INT reStyle = WS_CHILD|WS_VISIBLE|ES_MULTILINE|ES_WANTRETURN|WS_VSCROLL|WS_HSCROLL|ES_AUTOVSCROLL|ES_AUTOHSCROLL|ES_SUNKEN
'INT reStyle = 0x508010C4 /::src code line::
richedit1 = SetEditBox(win,300,120,300,240," Multiline Edit Box"+chr(13)+chr(10)+"second line*****",reStyle ,0x200,reID)
hfont = GetStockObject(11)
SendMessage richedit1,WM_SETFONT,hfont,0
INT LCount = 0
'---------------------------------------------------------------------
'GoSub AddListboxItems
'--------------------------------------------------------------------

'--------------------------------------------------------------------
Wait()


Function WndProc(sys win,wMsg,wParam,lparam) as sys callback

SELECT wMsg
'----------------------------

CASE WM_CLOSE

'IF (win2=0) AND (win<>0)
DestroyWindow win
'print "w1 closed"
PostQuitMessage 0
'END IF



'IF win=0 then PostQuitMessage 0
'-------------------------------------------------------------
CASE WM_COMMAND
controlID = LoWord(wParam) 'get control ID
notifyCode = HiWord(wParam) 'get notification message

Select controlID
   CASE b1ID
If notifycode=0 
'Beep(1660,50)
    'Print "Button 1 Clicked!"

End If

   CASE b2ID ' fill array fast
     If notifycode=0
 
End If

  CASE b3ID
If notifycode=0

End If

  CASE b4ID
If notifycode=0

End If

  CASE b5ID
If notifycode=0

End If




End Select
'-----------------------------------------------------
END SELECT


Return DefWindowProc win,wMsg,wParam,lParam


END FUNCTION




'#########################################################




[attachment deleted by admin]

Charles Pegge

  • Guest
Re: Is there a sample oxygen code on combobox?
« Reply #2 on: March 04, 2018, 09:36:44 AM »
Hi Karen,

I derived this from the ListBox example ( examples\WinDynDialogs\ListBox.o2bas )


[attachment deleted by admin]

Aurel

  • Guest
Re: Is there a sample oxygen code on combobox?
« Reply #3 on: March 04, 2018, 10:07:32 AM »
Hi Charles
where you have this:
examples\WinDynDialogs\ListBox.o2bas

I have A043 version and under folder \examples
there is no subfolder WinDynDialogs ?

Also i never see this example about ListBox ??

or i must download latest release with uses directive ?

Karen Zibowski

  • Guest
Re: Is there a sample oxygen code on combobox?
« Reply #4 on: March 04, 2018, 10:39:39 AM »
Many Thanks Charles and Aurel
Charles's program is like a listbox and can be compiled to 64bits while Aurel's is a combobox
but couldn't compile to 64bits.  That is after compiling successfully, it exit abruptly when run.

Charles Pegge

  • Guest
Re: Is there a sample oxygen code on combobox?
« Reply #5 on: March 04, 2018, 11:24:17 AM »
There's also DropDownList & SortedCombo :)

Aurel, you will need OxygenBasicProgess.zip to run these demos. They have dependencies:

https://github.com/Charles-Pegge/OxygenBasic/blob/master/oxygenBasicProgress.zip


[attachment deleted by admin]

Aurel

  • Guest
Re: Is there a sample oxygen code on combobox?
« Reply #6 on: March 04, 2018, 11:28:15 AM »
OK Charles ..  :)
I download from Github OxygenProgress and nothing there ..also my 7zip exit with broken files when
decompressing..

jcfuller

  • Guest
Re: Is there a sample oxygen code on combobox?
« Reply #7 on: March 04, 2018, 11:48:04 AM »
Charles,
  You have OxygenBasicProgess.zip and oxygenBasicProgess.zip on your git.
The one with the Captial "O" is the latest
James

Charles Pegge

  • Guest
Re: Is there a sample oxygen code on combobox?
« Reply #8 on: March 04, 2018, 12:42:42 PM »
Yes, sorry about that. I did not anticipate case-sensitivity.

https://github.com/Charles-Pegge/OxygenBasic/blob/master/OxygenBasicProgress.zip

I hope you get a clean download, Aurel. I use 7-zip for compression too.

Aurel

  • Guest
Re: Is there a sample oxygen code on combobox?
« Reply #9 on: March 04, 2018, 02:04:52 PM »
Yes i download proper version and both examples work properly
as you may see...
 :)

[attachment deleted by admin]

Karen Zibowski

  • Guest
Re: Is there a sample oxygen code on combobox?
« Reply #10 on: March 05, 2018, 07:15:41 AM »
Many Thanks Charles
Got it compiled to 64bits too

Regards
Karen