OpenDCL Forums

OpenDCL => Runtime/AutoLISP => Topic started by: mclisp on January 25, 2013, 01:45:32 AM

Title: help to manage database files .mdb
Post by: mclisp on January 25, 2013, 01:45:32 AM
I greet all
I'm starting to use OpenDCL I need help.
with adolisp the library, I have to handle many files. mdb access.
I can create a list with the names of file.mdb example  ("file1" "file2" "file3")
I can create a list with the names of the tables contained in the above file example ("tab1" "tab2" "tab3" "tab4")
I can create a list with the names of all the column headings example  ("col1" "col2" "col3" col4")
I can create a list of all data row from the file example (("row1" 1 2 3)("row2" 1 2 3)("row3" 1 2 3))

I would like to to read and display the values of each row of these file. mdb using combobox
and text boxes to display the values
anyone have an example to do this.
any help is appreciated.
thanks
mclisp
Title: Re: help to manage database files .mdb
Post by: Fred Tomke on January 25, 2013, 08:52:55 AM
Hi, do you mean filling a combobox with a list of field values? Then you have to use (dcl_Control_SetList myproj_myform_mycombo lstNewValues).
But if you mean a combobox in a grid then you have to set the list by using  (dcl_Grid_SetCellDropList myproj_myform_mygrid 5 2 lstNewValues).
Maybe you have a small project to illustrate.

Regards, Fred
Title: Re: help to manage database files .mdb
Post by: mclisp on February 01, 2013, 02:59:17 AM
hi
I managed to do what I asked above thanks
now I have another problem:
because this function (drawrectangle) CheckBox works

(defun c:Rectangle_Form1_CheckBox1_OnClicked (Value /)
  (setq Diagonal Value)(princ)
    (drawrectangle) <<<<<<<<<<<<<<<<<<<ok work
(princ))

This function (drawrectangle) ComboBox does not work
(defun c:Rectangle_Form1_ComboBox3_OnSelChanged (ItemIndexOrCount Value / )
(setq n ItemIndexOrCount
      #Name (nth n #ListaNomiProfili) <<ok work
      #Data (nth n #TableData))         <<<ok work
(drawrectangle)<<<<<<<<<<<<<<<<<<<<< NO Work
    )

what is wrong?
Thank you for your time
Title: Re: help to manage database files .mdb
Post by: mclisp on February 02, 2013, 04:06:18 AM
here you can see how the function (DrawRectangle) works with CheckBox,  works with TextBox 
and does not work with ComboBox
Why?

http://www.youtube.com/watch?v=wX8jUmiUZ4k&feature=youtu.be (http://www.youtube.com/watch?v=wX8jUmiUZ4k&feature=youtu.be)
Title: Re: help to manage database files .mdb
Post by: owenwengerd on February 02, 2013, 08:08:00 AM
Quote from: mclisp on February 02, 2013, 04:06:18 AM
here you can see how the function (DrawRectangle) works with CheckBox,  works with TextBox 
and does not work with ComboBox

Where exactly can I see (DrawRectangle)? I watched your video, but did not see that code anywhhere.
Title: Re: help to manage database files .mdb
Post by: mclisp on February 02, 2013, 11:15:37 PM
hello
Thank you for your time.
I'm learning OpenDCL be patient.
I simplified the program to repeat what does not work.
if I change the value of the function COMBOBOX3 (DrawRectangle) crashes and error: invalid AutoCAD command: nil
this error does not happen with TEXTBOX and CHECBOX.
I want that if I change the value in COMBOBOX3 you redraw the rectangle.
thanks again.
Title: Re: help to manage database files .mdb
Post by: owenwengerd on February 03, 2013, 08:04:44 AM
Good job at simplifying the problem. When your event handler code is called from a modeless form, you have to be careful about calling the (command) function. If you set the Event Invoke property for your combo box controls to 1 - Asynchronous, calls to the (command) function should work. You can check the OpenDCL help or search the forum for 'asynchronous' to read more.
Title: Re: help to manage database files .mdb
Post by: mclisp on February 03, 2013, 09:54:02 AM
thank you very much owenwengerd
I was going crazy, now works
ciao
Title: Re: help to manage database files .mdb
Post by: mclisp on February 19, 2013, 12:29:08 AM
I want to share my efforts to learn OpenDCL use version 7.0.0.5
https://sites.google.com/site/mclisp/prosteel-3d-creating-parametric-cross
I am very happy and I thank you for your help.
I still ask for help, I want to insert the image above a CHECK BOX
but I can not, it is still below the image,
even if active the Send to Back Control OFZ / Tab order
you have any idea?
thanks again
Title: Re: help to manage database files .mdb
Post by: Fred Tomke on February 19, 2013, 11:22:06 AM
Hi, make sure that the backcolor of the checkbox is not -24 (transparent).
Regards, Fred
Title: Re: help to manage database files .mdb
Post by: owenwengerd on February 19, 2013, 12:44:09 PM
Tab/Z order does not control painting order. The only thing that Windows guarantees is that transparent controls will always be painted after non-transparent sibling controls. If you want the check box "above" the picturebox, then the check box must be transparent and the picture box must not be transparent. You may also find it helpful to uncheck "Use visual style" for the check box, as the current checkbox visual style may not support transparency.
Title: Re: help to manage database files .mdb
Post by: mclisp on February 20, 2013, 01:45:16 AM
perfect,  very nice
I have many macros you create the interface,
I can have your opinion, critical, defect, problem on my method of creating form.
ie with background image.
I find it very intuitive?
easy to use and does not require a lot of translation in different languages.
what do you think.
what are the problems that you may encounter?
what do you think
thanks again
Title: Re: help to manage database files .mdb
Post by: mclisp on March 27, 2013, 06:38:55 AM
hi
wonder if it is possible to rotate a textbox of 90 °.
For now believe is not possible,
you could do in the future?
thanks
Title: Re: help to manage database files .mdb
Post by: owenwengerd on March 27, 2013, 07:32:05 PM
A text box is a standard Windows control that doesn't support rotation, so it isn't possible without making a new control type.
Title: Re: help to manage database files .mdb
Post by: mclisp on March 28, 2013, 12:28:48 PM
I like to think that one day there will be this new control.
thanks anyway