Hi Jeff,
Something is wrong with my design of a new dialog, but what ???
I declared some text boxes and check boxes as follows:
SUBROUTINE CSp_item_dlg
USE Appgraphics
use StrPartGlobals ! contains declaration of derived parts
use W_ords_to_pixels ! need because procedures in StrPartGlobals
CHARACTER*4 STR(12)
CHARACTER*4 STRG
INTEGER dlg_screen, primary_fr
integer box1, box2, box3, box4, box5, box6, box7, box8, box9, box10
integer cbox1,cbox2
integer Ignore, contin, settype
logical*1 checked(3)
Data checked/ 3*.false./
external part_type_dlg
…...
…...test data....
…...
After setting the dlg window text and boxes are defined as follows:
settype = createbutton(315,20,70,20,"type", part_type_dlg)
Call outtextxy(10, 20,'Title')
box1 = createtextbox(10, 40, 180,16); call Settextboxcontents(box1,CSP(isp)%title) !Box1
Call outtextxy(200, 20,'property')
box2 = createtextbox(200, 40, 100,16); call Settextboxcontents(box2,CSP(isp)%prop) !box2
Call outtextxy(310, 40,'(mm or profile)')
Call outtextxy(10,60,'corrosion allowance')
box3 = createtextbox(135, 60, 65,16); call Settextboxcontents(box3,str(6)) !box3 -str(6)
Call outtextxy(200, 60,'mm')
Call outtextxy(10,80,' Material quality:')
box4 = createtextbox(130, 80, 65,16); call Settextboxcontents(box4,CSP(isp)%grd) !box4
Call outtextxy(10,100,'Part is on frame:')
box5 = createtextbox(130, 100, 40,16); call Settextboxcontents(box5,str(2)) !box5
Call outtextxy(180,100,'Primary frame:');Write(strg,'(i4)')primary_fr
box6 = createtextbox(270, 100, 40,16); call Settextboxcontents(box6,strg) !box6
!preliminary to be found from the repeat rules
Call outtextxy(10,120,'number of parts P+S:')
box7 = createtextbox(130, 120, 40,16); call Settextboxcontents(box7,str(3)) !box7
Call outtextxy(10,140,'conection poin 1:')
box8 = createtextbox(130, 140, 40,16); call Settextboxcontents(box8,str(4)) !box8
Call outtextxy(10,160,'conection poin 2:')
box9 = createtextbox(130, 160, 40,16); call Settextboxcontents(box9,str(5)) !if plate, otherwise disableed
Call outtextxy(10,180,'profile rotation:')
box10= createtextbox(130, 180, 40,16); call Settextboxcontents(box10,str(5))!if profile, otherwise disableed
cbox1 = createcheckbox (180, 180, 200,20,'Mirror x-dir', update1)
cbox2 = createcheckbox (280, 180, 250,20,'Mirror y-dir', update2)
Call checkboxsetchecked (cbox1,checked(1))
Call checkboxsetchecked (cbox2,checked(2))
Call outtextxy(10,200,'profile rotation anti clockwize against upright position')
Call outtextxy(10,280,'Parts on current frame are repeated on every frame exept primary frame')
!___________ enable / disable parts depending on type ____________________
Call enabletextbox (box6, .false.) !______________ also disable primary frame / no user input
select case (CSP(isp)%typ)
CASE (101,111)
Call enabletextbox (box10, .true.) !if plate
Call enabletextbox (box9, .false.) !if profile
CASE default
Call enabletextbox (box9, .true.)!true.)
Call enabletextbox (box10, .false.) !if plate
end select
contin = createbutton(15,420,50,20,"OK", cont)
Ignore = createbutton(65,420,50,20,"cancel", quit_dlg)
call loop
Call closewindow(CURRENT_WINDOW)
Call setcurrentwindow (initW)
Three odd behaviors:
Now Box 6 has to be disabled but the test program shows box 5 disabled
Independent on part type always Box9 is disabled
At least only chekbox 1 can be checked/unchecked
There must be something wrong with the box numbers I suppose. But I cannot find what.
Debugging shows 12 unique numbers for all boxes!
Do you have any suggestion what I am doing wrong?