Fai la tua domanda

docbda's profile - attività

2019-03-03 05:03:17 +0100 received badge  Tassonomista
2018-07-27 00:13:50 +0100 received badge  Domande famose (source)
2018-06-13 23:32:14 +0100 received badge  Domande famose (source)
2018-01-14 19:41:29 +0100 received badge  Buona risposta (source)
2017-11-22 16:21:46 +0100 ha accettato una risposta Combo box, how to get more than one field to appear in the list content?

I am attempting to set up a combo box so that data from multiple fields (LastName, FirstName, DOB, id) will appear in the list contents of a combo box. Despite hours of research, I can only get one field to appear in the list contents. The table that my form is based on and the table containing fields that I would like to appear in the list contents of the combo box are linked properly. I have tried both Base assisted query design, and native mySQL queries in the "type of list contents" and "list content" options under the "data" tab of the combo box properties without success. In both instances the queries run without error and give the appropriate results, but only the field in the first column of a Base assisted query or the first field listed under a SELECT command in a native mySQL query will populate the list contents.

In the Base documentation, it does state that it is impossible to have more than one field listed in the list contents of a combo box if the combo box wizard is used. The documentation does imply that it is possible if the wizard is not used, but it does not give an example of how this is done. I have turned off the wizard and filled in the properties by hand and obtained a functional combo box, but not one with more than one field in the list contents. There is an example in the LO Base tutorial on page 108 that shows multiple fields in a list box list selection. I have tried to duplicate the syntax of the mySQL commands listed under "bound field" in the list box properties shown in the example, but with no luck.

Any help would be appreciated.

Thanks,

2017-11-22 16:21:45 +0100 received badge  Autodidatta (source)
2017-09-21 10:43:57 +0100 ha accettato una risposta Insert macro generated text into a textbox?

I'm looking for a method to insert text into a Base form textbox either via macro generated text or via LO's AutoText function.

More specifically, I am attempting to use a push button form control linked to a simple text macro to input text into a text box form control. I have been able to set up a push button form control to input text via a macro into a Write document without difficulty. However, I can't get the same text to input into a text box when the text box has focus and the push button is activated. I did select NO on the "take focus on click" form control option for the push button, but this made no difference.

I have also tried inserting AutoText into a textbox form control without success. Again, I was able to successfully set up the desired autotext and insert it into a Write document via control/F3, but this function does not work properly when the cursor is within a text box contained in a Write document.

In more general terms, I have an image with several invisible push button "hot spots" overlayed on the image. Each push button is linked to a different text descriptor that I would like inserted into a text box when the push button is activated via a mouse click. For example, let's say that the background image is a face. I have push buttons overlaying the eyes, nose, mouth, ears, etc. When the push button is activated over the nose, I would like the text "nose" to appear in the text box that has focus (i.e., has the cursor located within the textbox).

Is what I'm attempting possible in LO? If not, can anyone think of an alternative method to accomplish the same task utilizing LO?

Thanks in advance,

docbda

2017-07-29 12:26:09 +0100 received badge  Domande famose (source)
2016-11-24 09:46:30 +0100 received badge  Studente (source)
2016-11-24 09:21:15 +0100 received badge  Domande famose (source)
2016-09-24 20:36:23 +0100 received badge  Domande famose (source)
2016-09-09 17:09:18 +0100 received badge  Domanda notevole (source)
2016-09-09 17:08:21 +0100 received badge  Domande famose (source)
2016-09-09 17:07:54 +0100 received badge  Domande famose (source)
2016-09-09 17:07:24 +0100 received badge  Domanda notevole (source)
2016-07-15 15:32:57 +0100 received badge  Domanda notevole (source)
2016-07-04 23:17:11 +0100 received badge  Domande famose (source)
2016-06-26 23:59:01 +0100 received badge  Domande famose (source)
2016-06-20 09:00:14 +0100 received badge  Domande famose (source)
2016-06-18 20:12:04 +0100 received badge  Domanda notevole (source)
2016-06-18 18:01:04 +0100 ha accettato una risposta Run macro line by line in LO basic IDE?

Hi folks!

Looking for a way to run my LO Basic macro line by line for debugging puroses. I know you can do this in the MS Office IDE via "F8". Is there similar functionality in the LO IDE?

Thanks

2016-06-13 22:32:15 +0100 received badge  Domanda notevole (source)
2016-05-28 11:38:53 +0100 received badge  Domanda notevole (source)
2016-05-28 11:38:53 +0100 received badge  Domanda gettonata (source)
2016-05-07 14:24:43 +0100 received badge  Domande famose (source)
2016-04-20 01:14:39 +0100 ha risposto a una domanda How to enter text into a dialog textbox via macro?

In order to access a text box (or any other control for that matter) in a dialog you have to get the control first, and then get the model for the control. Aferwhich, you can set the properties of the control model. The "model" is essentially all of the properties that you can set for a dialog control if you were in the dialog window of the LO Basic IDE. In the case of my text box, the property that I want to set is "text". Of course, different controls have different properties that can be set. You have to look up the properties that can be set for the given control you are working with. A list of the properties for the control that you are working with is likely included in the tables of chapter 18 in Open office.org "Macros Explained" by Andrew Pitonyak. You can easily find this in pdf format if you Google it.

Below is the required syntax:

Sub StartDialog_show_loc(anatomy)

    Dim oDoc as Object
    Dim  oLib As Object, myDlg As Object, oDlgField As Object, oTBmodel As Object

   REM set oDoc object variable to the current document 
oDoc = ThisComponent 
   REM Load "Standard" library
DialogLibraries.LoadLibrary("Standard") 
    REM Load dialog libraries
oLib = DialogLibraries.GetByName("Standard") 
     REM set myDlg to dialog named "Dialog_Location"
myDlg = oLib.GetByName("Dialog_location") 
     REM create Uno object "myDlg" which creates the dialog
oDlg = CreateUnoDialog(myDlg)
     REM obtain the control and control model
oTBmodel = oDlg.GetControl("TextField1").getModel() 
     REM set the text property of the text box to the string variable "anatomy"
oTBmodel.Text = anatomy 
     REM execute the dialog
oDlg.execute() 

    End Sub
2016-04-19 22:38:21 +0100 ha posto una domanda How to enter text into a dialog textbox via macro?

Following is my code that declares variables that should allow me to access a textbox named "TextField1" in a dialog box named "Dialog_location"

Sub StartDialog_show_loc

Dim oDoc as Object
Dim  oLib As Object, myDlg As Object, oDlgField As Object

oDoc = ThisComponent
DialogLibraries.LoadLibrary("Standard")
oLib = DialogLibraries.GetByName("Standard")
myDlg = oLib.GetByName("Dialog_location")
oDlg = CreateUnoDialog(myDlg)
oDlgField = oDlg.GetByName("TextField1")

oDlgField.text = Anat_butt
oDlg.execute()


End Sub

When this bit of code runs, I get "Property or method not found: GetByName" and the line of code "oDlgField = oDlg.GetByName("TextField1")" is highlighted in the BASIC IDE. Is there a problem with my syntax here, or am I going about this completely wrong?

Thanks in advnace docbda

2016-04-15 04:12:50 +0100 ha commentato una risposta How to properly code a broadcaster and listener in LO Basic

That is a much easier solution!!! Although, at some point I need to learn how to code the listener too. I might give it a try anyway just to complete this post for the next guy that comes along that needs some help in this regard. Thanks, as always.

2016-04-15 00:53:21 +0100 received badge  Domanda gettonata (source)
2016-04-14 21:40:55 +0100 ha commentato una risposta How to properly code a broadcaster and listener in LO Basic

Result: SbxEMPTY queryInterface ( SbxOBJECT ) SbxVOID addActionListener ( SbxOBJECT ) SbxVOID removeActionListener ( SbxOBJECT ) SbxVOID setLabel ( SbxSTRING ) SbxVOID setActionCommand ( SbxSTRING ) ...OK, back to Pitonyak I'll be in touch

2016-04-14 21:37:16 +0100 ha commentato una risposta How to properly code a broadcaster and listener in LO Basic

When I first tried to run this I had a run-time error. I just tried it again, and it worked fine. The methods you needed to code were: SbxEMPTY queryInterface ( SbxOBJECT ) SbxVOID disposing ( SbxOBJECT ) SbxBOOL keyPressed ( SbxOBJECT ) SbxBOOL keyReleased ( SbxOBJECT )

Now for step 2...

2016-04-14 21:02:47 +0100 ha commentato una risposta How to properly code a broadcaster and listener in LO Basic

I see where you commented out sService = XButton. Not sure how I "start there and try Pitonayak's book again." Remember ... super noob here...

2016-04-14 20:53:23 +0100 ha commentato una risposta How to properly code a broadcaster and listener in LO Basic

I'm guessing that I need to add some dummy code to disposing, and replace your If Then Else statements in KeyPressed and KeyReleased with more dummy code, but I'm not sure how to go about this. I apologize for my ignorance.

2016-04-14 20:51:41 +0100 ha commentato una risposta How to properly code a broadcaster and listener in LO Basic

Ratslinger, Here's what I've done so far: 1) copied both pieces of code into the same module. 2) identified where sService is set for XKeyHandler. I'm not sure how I need to modify this. 3) I identified _Disposing (which was an empty sub routine), _KeyPressed (function that stated if keys 1280 or 1284 were pressed, then KeyHandler_KeyPressed was True), and _KeyRealeased (function that says if oEvent.KeyCode = 1280 then _KeyReleased is false. You state that these items need definitions.

2016-04-14 20:04:42 +0100 ha commentato una risposta How to properly code a broadcaster and listener in LO Basic

Whoa!!! Thanks a ton. Let me digest this, and I'll get back to you with the questions I'm sure to have. docbda

2016-04-14 19:29:07 +0100 ha commentato una risposta How to close running dialog box via macro

I see. Thanks for the explanation. Looks like I need to download Mri and learn how to use it. This is similar to Xray, right?

2016-04-14 19:16:47 +0100 ha posto una domanda How to properly code a broadcaster and listener in LO Basic

I have read Pitonyak's section on listeners in OOo Macros Explained, and it left me bewildered and confused (but bless his heart for taking the time to write such a comprehensive document on OOo Basic). Unfortunately, I'm quite new at coding in OOo Basic (and coding in general) and I'm trying to learn on the fly (by doing). Therefore, much of his explanation went zinging over my head.

That said, here's what I'm trying to accomplish:

I'm writing a macro contained within in a Base form. In this macro, I have several image buttons that when clicked pass a text string to a textbox via a short sub routine that is triggered when the mouse button is pressed on the image button. Each of these image buttons have their own unique text string. At times, I will need to concatinate two of these text strings together (originating from different buttons).

The problem is that I don't know in what order the buttons will be pushed, so I need the macro to detect when a second (or third, fourth, fifth, etc) is pushed and add the string associated with that button to the growing text string. Therefore, I need the macro to "listen" for one of the image buttons to be pushed (I'm assuming the image button would be the broadcaster), and when detected by the listener, pass the detected button's associated text string to the subroutine that is building the concatinated text string.

When I read Pitonyak's statement, "Knowing which broadcaster to use is not always an easy task. It requires understanding how OOo is designed; this comes with experience." I knew i was in trouble.

If someone would be kind enough to show me some example code that is a possible solution for the above, or point me toward a tutorial regarding this topic that is slanted more toward the beginner, I would be most appreciative.

Cheers.

docbda

2016-04-14 18:48:30 +0100 ha accettato una risposta How to close running dialog box via macro

I'm attempting to close a dialog named oDlg with the code below. oDlg is defined as a public object variable as I'm attempting to close a dialog that is created by another sub. I have tried killdlg as both private and public which makes no difference. Not sure what I'm doing wrong. I appreciate any input. Obviously, I"m a LO basic noob.

Thanks in advance.

Sub Close_dialog

killdlg= createUnoService("com.sun.star.awt.XDialog")
oDlg.killdlg.endexecute()

End Sub