1. Tomáš Podzimek
  2. PowerBuilder
  3. Thursday, 30 May 2024 19:01 PM UTC

Hi,

I've just found out that a window created by a MessageBox function is immune to ApplyTheme. It still has the default Windows look.
Since no one has complained about it, it's not a big deal but from now on, it catches my eye.
Is there a way how to easily fix this? (And no, replacing MessageBox with a pfc messagebox is not an option, there are too many messageboxes all over the place).
Using PB 2022 R3.

Regards,
Tomáš

Accepted Answer
Arthur Hefti Accepted Answer Pending Moderation
  1. Friday, 31 May 2024 12:12 PM UTC
  2. PowerBuilder
  3. # Permalink

You can create a global function messagebox and edit the source to include all possible options. See below.

global type messagebox from function_object
end type

forward prototypes
global function integer messagebox (string as_title, string as_text, icon aico_icon, button abut_button, integer ai_default)
global function integer messagebox (string as_title, string as_text, icon aico_icon, button abut_button)
global function integer messagebox (string as_title, string as_text, icon aico_icon)
global function integer messagebox (string as_title, string as_text)
end prototypes

global function integer messagebox (string as_title, string as_text, icon aico_icon, button abut_button, integer ai_default);

// code do display window goes here 

end function

global function integer messagebox (string as_title, string as_text, icon aico_icon, button abut_button)
return messagebox( as_Title, as_Text, aico_icon, abut_button, 1 )
end function

global function integer messagebox (string as_title, string as_text, icon aico_icon)
return messagebox( as_Title, as_Text, aico_icon, OK!, 1 )
end function

global function integer messagebox (string as_title, string as_text)
return messagebox( as_Title, as_Text, Information!, OK!, 1 )
end function

 

Comment
There are no comments made yet.
Tomáš Podzimek Accepted Answer Pending Moderation
  1. Friday, 31 May 2024 11:17 AM UTC
  2. PowerBuilder
  3. # 1

Thanks Arthur, I will try that!

Comment
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.