May 15, 2024, 12:47:23 PM

News:

IonicWind Snippit Manager 2.xx Released!  Install it on a memory stick and take it with you!  With or without IWBasic!


problems with list boxes

Started by chris, November 22, 2008, 10:41:42 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

chris

i can't seem to put any strings in to listboxes the box is blank eventho i've used addstring i've tryed looking at the examples but no luck i think is something simple and i'm just missing it. thanks in advace for help
CONST BUTTON_1 = 1
CONST EDIT_4 = 4
CONST COMBO_5 = 5
CONST COMBO_7 = 7
CONST STATIC_10 = 10
CONST STATIC_11 = 11
CONST STATIC_12 = 12
CONST EDIT_13 = 13
CONST BUTTON_14 = 14
DIALOG d1
SETFONT d1,"Courier New",12,400,0,5
CREATEDIALOG d1,0,0,660,187,0x80C80080,0,"Convert",&d1_handler
CONTROL d1,@SYSBUTTON,"Convert",483,27,92,49,0x50000000,1
CONTROL d1,@EDIT,"Input",72,32,121,28,0x50800000,4
CONTROL d1,@STATIC,"Convert",6,37,70,20,0x5000010B,10
CONTROL d1,@STATIC,"Degrees",202,35,70,20,0x5000010B,11
CONTROL d1,@STATIC,"To",331,29,70,20,0x5000010B,12
CONTROL d1,@EDIT,"Output",47,120,408,33,0x50800800,13
CONTROL d1,@SYSBUTTON,"Copy to Cilpbord",493,121,97,31,0x50000000,14
CONTROL d1,@LISTBOX,"TypeIn",277,26,36,60,0x50800140,15
CONTROL d1,@LISTBOX,"TypeOut",417,26,34,60,0x50800140,16
addSTRING d1,15, "C"
addSTRING d1,16, "F"
addSTRING d1,15, "F"
addSTRING d1,16, "C"
SHOWDIALOG d1
run = 1
WAITUNTIL run = 0
CLOSEDIALOG d1,@IDOK
SUB d1_handler
SELECT @MESSAGE
CASE @IDINITDIALOG
CENTERWINDOW d1
' Initialize any controls here
CASE @IDCLOSEWINDOW
CLOSEDIALOG d1,@IDOK
run = 0
CASE @IDCONTROL
SELECT @CONTROLID
CASE BUTTON_1
IF @NOTIFYCODE = 0
'button clicked
DEF input$, output$ :STRING
DEF TypeIn$, TypeOut$ : CHAR
input$ = GETCONTROLTEXT (d1,EDIT_4)
ENDIF
CASE EDIT_4
' respond to edit notifications here
CASE COMBO_5
'respond to control notifications here
CASE COMBO_7
'respond to control notifications here
CASE EDIT_13
'respond to edit notifications here
CASE BUTTON_14
IF @NOTIFYCODE = 0
'button clicked
ENDIF
ENDSELECT
ENDSELECT
RETURN
ENDSUB


yours
chris

LarryMc

Chris

You just got bit by a dialog.

Controls in a dialog don't exists until @idinitdialog is sent & you can't 'add' anything to something that doesn't exist

Move this:addSTRING d1,15, "C"
addSTRING d1,16, "F"
addSTRING d1,15, "F"
addSTRING d1,16, "C"
to here:CASE @IDINITDIALOG
    CENTERWINDOW d1
    ' Initialize any controls here
     addSTRING d1,15, "C"
     addSTRING d1,16, "F"
     addSTRING d1,15, "F"
     addSTRING d1,16, "C"


The phrase
Quote' Initialize any controls here
kinda gives a hint ;)

I've been bitten in the butt I don't know how many times by for getting that about dialogs.

Larry

LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

chris

thank you. i told you it would be something simple no? anyway thank you this is my first stab at a GUI for a program and if it wasn't for the fact winsock needs a window i would still be happly playing with the console:)

many thanks
chris