Using LO Version: 4.4.6.3 on an iMAC with OSX 10.10.5
[Warning this is a LONG description for a short question]
I’m building a series of dialogs as a more flexible & customisable version of MSGBOX but I’m having trouble getting the graphic icons to stick in the design. Here’s my Information dialog design:
You’ll see that I’ve just added the graphic (the blue circle with the I )
if i exercise the TEST MODE ON/Off you’ll see all is as it should be like this:
If I now save the design and open the dialog with this code:
'============================================================================================
' general purpose test harness for developing routines
sub Testy
call DialogMsgBox("this is a test message",mbInformation,"This is the TITLE", "Btn1 Text", 7)
end Sub
'============================================================================================
function DialogMsgBox(theMsg as string, dialogType as integer,theTitle as string,_
 Button1Text as string, Button1Response as integer, _
 optional Button2Text as string, optional Button2Response as integer, _
 optional Button3Text as string, optional Button3Response as integer, _
 optional DefaultButtonNo as integer) as integer
dim oDialog1		as object
dim oDialog1Model	as object
Dim NoOfButtons		as integer 
Dim oMsg			as object
Dim oTitle			as object
dim oCMD1			as object
dim oCMD2			as object
dim oCMD3			as object
dim oGraphic		as object
    DialogLibraries.LoadLibrary("Standard")
 ' sort out dialogType
 	select case dialogType
 		case=mbSTOP
   			oDialog1 = CreateUnoDialog( DialogLibraries.Standard.DialogStop)
 		case=mbQUESTION
   			oDialog1 = CreateUnoDialog( DialogLibraries.Standard.DialogQuestion)
 		case=mbEXCLAMATION
   			oDialog1 = CreateUnoDialog( DialogLibraries.Standard.DialogAlert)
 		case=mbINFORMATION
   			oDialog1 = CreateUnoDialog( DialogLibraries.Standard.DialogInformation)
 		case=mbCONFIRMATION
   			oDialog1 = CreateUnoDialog( DialogLibraries.Standard.DialogConfirmation)
     end select		
    oDialog1Model = oDialog1.Model
'    msgbox oDialog1Model.Dbg_Properties
' set the graphic
	oGraphic= oDialog1Model.Graphic
  msgbox oGraphic.Dbg_Properties
'    msgbox oGraphic.Dbg_Methods
       
' get no of buttons
	if isMissing(Button2Text) then     
    		NoOfButtons=1
    else
    	if isMissing(Button3Text) then
    		NoOfButtons=2
    	else
    		NoOfButtons=3
    	endif
    endif
' assign DefaultButtonNo
    if isMissing(DefaultButtonNo) then
    	dbno=1
    else
    	if dbno>NoOfButtons then
    		dbno=1
    	else
    		dbno=DefaultButtonNo
    	endif
    endif  
    
' assign Title
    oDialog1Model.Title=  oDialog1Model.Title & " " & theTitle
' and the message    
    oMsg=oDialog1Model.Msg
    oMsg.Text=themsg & chr(13) & chr(13) & "The Number of buttons=" & cstr(NoOfButtons) 
' make button(s) visible with text    
    oCMD1= oDialog1Model.CommandButton1
    oCMD2= oDialog1Model.CommandButton2
    oCMD3= oDialog1Model.CommandButton3
    select case NoOfButtons
    	case = 1
    		oCMD1.EnableVisible=FALSE
    		oCMD2.EnableVisible=FALSE	
    		oCMD3.EnableVisible=TRUE	
    		oCMD3.Label=Button1Text
    	case = 2
    		oCMD1.EnableVisible=TRUE
    		oCMD2.EnableVisible=TRUE	
    		oCMD3.EnableVisible=FALSE
    		oCMD1.Label=Button1Text
    		oCMD2.Label=Button2Text	
    	case = 3
   			oCMD1.EnableVisible=TRUE
    		oCMD2.EnableVisible=TRUE	
    		oCMD3.EnableVisible=TRUE
    		oCMD1.Label=Button1Text
    		oCMD2.Label=Button2Text
    		oCMD3.Label=Button3Text	
    end select
  oDialog1.execute()
End function
What I get is this !?
What’s more If I go back to the design and re-open with EDIT it I see this:
Notice that the graphic is missing ?!
My 1st question is what am I doing wrong, or is this a bug?
My 2nd question is I’d like to collapse the four dialog’s into one general purpose dialog but for that I’d have to be able to make the background and the graphic dynamic i.e. assignable by the macro. How can I do that?
 
      
    