April 27, 2024, 09:09:10 AM

News:

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


Cannot get COMBOBOX to work

Started by Dennisc, January 23, 2007, 12:30:19 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Dennisc

I am doing something wrong I know but for the love of me, I cannot see what. In this code snippet, the COMBOBOX controls do not do what they have to. When it runs, click the Test key and try to select a month using the COMBOBOX controls. Also TAB between the controls - sometimes seems to work but pull down does not want to activate... Any help gladly accepted  :-[

Please excuse the quality of the coding, I have extracted it from a large program.

Thanks
Dennis

$MAIN
AutoDefine "Off"

DEF winMain: WINDOW 
DEF MonthTable: STRING
DEF h,i,j,k,l,m,n,t,w,x,y,z: INT 
DEF FillError: INT
DEF intMainRun: INT   

MonthTable = "JanFebMarAprMayJunJulAugSepOctNovDec"
 
'------------------------------------------------------------ Open Main Window 
w = 1024 
h = 768 
l = 0 
t = 0 
 
OPENWINDOW winMain,l,t,w,h,@MINBOX|@MAXBOX|@MAXIMIZED,0,"Test",&wsubMainWindow 
 
SETWINDOWCOLOR winMain,RGB(236,233,216) 
CONTROL winMain,@Button,"Test",650,630,80,40,@TABSTOP,112
CONTROL winMain,@Button,"Exit",850,630,80,40,@TABSTOP,113

'------------------------------------------------------------ Define Dialog 
DEF dlgDefine:DIALOG 

CREATEDIALOG dlgDefine,0,0,420,475,0x80C00080,0,"Profile Definition",&dsubDefineHandler
CONTROL dlgDefine,@Static,"Profile file name: xxxxxxxxxx",22,12,225,20,0x5000010B,201
CONTROL dlgDefine,@Static,"Short description:",20,50,165,20,0x5000010B,202
CONTROL dlgDefine,@Static,"Full description:",20,80,165,20,0x5000010B,203
CONTROL dlgDefine,@Static,"Start month:",20,200,165,20,0x5000010B,204
CONTROL dlgDefine,@Static,"End month:",20,250,165,20,0x5000010B,205
CONTROL dlgDefine,@Edit,"",138,50,150,20,@TABSTOP,1
CONTROL dlgDefine,@RichEdit,"",20,103,370,83,@VSCROLL|@CTEDITMULTI|@TABSTOP,2
CONTROL dlgDefine,@COMBOBOX,"",120,200,55,20,@CTCOMBODROPDOWN|@TABSTOP|@VSCROLL,3
CONTROL dlgDefine,@COMBOBOX,"",120,250,55,20,@CTCOMBODROPDOWN|@TABSTOP|@VSCROLL,4
CONTROL dlgDefine,@Button,"OK",85,440,70,26,0x50000000,112
CONTROL dlgDefine,@Button,"Cancel",185,440,70,26,0x50000000,113

'------------------------------------------------------------ Main Window Loop 
intMainRun = 1 
WAITUNTIL intMainRun = 0 

CLOSEWINDOW winMain 
END 
   
'------------------------------------------------------------ Main Window Routines 
SUB wsubMainWindow   
DEF n,q:INT   
 
SELECT @CLASS 
CASE @IDCLOSEWINDOW 
intMainRun = 0 
CASE @IDCONTROL 
SELECT @CONTROLID
CASE 112  :'Test
DOMODAL dlgDefine
CASE 113  :'Exit
intMainRun = 0 
ENDSELECT   
ENDSELECT 
RETURN 
ENDSUB

'------------------------------------------------------------ Define Routines   
SUB dsubDefineHandler   
SELECT @CLASS 
CASE @IDCONTROL 
SELECT @CONTROLID
CASE 3
  IF @NOTIFYCODE = @CBNSELCHANGE
                        k = GETSELECTED(dlgDefine,3)
                    ENDIF
CASE 112 
IF FillError = 0 
CLOSEDIALOG dlgDefine, @IDOK
ELSE
SETFOCUS dlgDefine
ENDIF  
CASE 113 
FillError = 1 
CLOSEDIALOG dlgDefine, @IDCANCEL 
ENDSELECT 
CASE @IDINITDIALOG
CENTERWINDOW dlgDefine
FOR i = 201 TO 205
SETFONT dlgDefine, "Arial", 10, 700, 0,i
NEXT i
FOR i = 1 TO 4
SETFONT dlgDefine, "Arial", 10, 700, 0,i
NEXT i
SETFONT dlgDefine, "Arial", 10, 700, 0,112
SETFONT dlgDefine, "Arial", 10, 700, 0,113
SETCONTROLTEXT dlgDefine, 201, "Profile filename: xxxxxxxx"
FOR i = 0 to 11
ADDSTRING dlgDefine,3,MID$(MonthTable,i*3+1,3)
ADDSTRING dlgDefine,4,MID$(MonthTable,i*3+1,3)
NEXT i
SETSELECTED dlgDefine, 3, 0
SETSELECTED dlgDefine, 4, 1
FillError = 0 
ENDSELECT 
RETURN 
ENDSUB
Failure is only the opportunity to begin again more intelligently
www.denniscomninos.com

sapero

Decrease (to 100px) the width of labels start/end month, they overlap the whole combo boxes, so you cannot click on the combo
And increase height of both combo's from 20 to atleast 100
CONTROL dlgDefine,@Static,"Start month:",20,200,100/*here*/,20,0x5000010B,204
CONTROL dlgDefine,@Static,"End month:",20,250,100/*here*/,20,0x5000010B,205
CONTROL dlgDefine,@COMBOBOX,"",120,200,55,160/*here*/,@CTCOMBODROPDOWN|@TABSTOP|@VSCROLL,3
CONTROL dlgDefine,@COMBOBOX,"",120,250,55,160/*here*/,@CTCOMBODROPDOWN|@TABSTOP|@VSCROLL,4

Dennisc

Thanks Sapero. I knew it was something I was doing wrong even after lots and lots of successfully designed and implemented windows and dialogs. I checked everything except for an overlap..... :-[  :-[

Regards
Dennis
Failure is only the opportunity to begin again more intelligently
www.denniscomninos.com

Dennisc


Thanks Sapero. I knew it was something I was doing wrong even after lots and lots of successfully designed and implemented windows and dialogs. I checked everything except for an overlap..... :-[  :-[  I had converted the comboboxes from edit controls which were not affected by the label overlap.

Regards
Dennis
Failure is only the opportunity to begin again more intelligently
www.denniscomninos.com