# :stopdoc: # This file is automatically generated by the WXRuby3 documentation # generator. Do not alter this file. # :startdoc: module Wx # This class makes it easy to tell your user that the program is temporarily busy. # Normally the main thread should always return to the main loop to continue dispatching events as quickly as possible, hence this class shouldn't be needed. However if the main thread does need to block, this class provides a simple way to at least show this to the user: just create a {Wx::BusyInfo} object on the stack, and within the current scope, a message window will be shown. # For example: # # wxBusyInfo wait("Please wait, working..."); # # for (int i = 0; i < 100000; i++) # { # DoACalculation(); # } # # It works by creating a window in the constructor, and deleting it in the destructor. # This window is rather plain by default but can be customized by passing {Wx::BusyInfo} constructor an object of {Wx::BusyInfoFlags} class instead of a simple message. Here is an example from the dialogs sample: # # wxBusyInfo info # ( # wxBusyInfoFlags() # .Parent(this) # .Icon(wxArtProvider::GetIcon(wxART_PRINT, # wxART_OTHER, wxSize(128, 128))) # .Title("Printing your document") # .Text("Please wait...") # .Foreground(*wxWHITE) # .Background(*wxBLACK) # .Transparency(4*wxALPHA_OPAQUE/5) # ); # # This shows that separate title and text can be set, and that simple markup ({Wx::Control#set_label_markup}) can be used in them, and that it's also possible to add an icon and customize the colours and transparency of the window. # You may also want to call {Wx::TheApp}->Yield() to refresh the window periodically (in case it had been obscured by other windows, for example) like this: # # wxWindowDisabler disableAll; # wxBusyInfo wait("Please wait, working..."); # # for (int i = 0; i < 100000; i++) # { # DoACalculation(); # # if ( !(i % 1000) ) # wxTheApp->Yield(); # } # # but take care to not cause undesirable reentrancies when doing it (see {Wx::App::Yield} for more details). The simplest way to do it is to use {Wx::WindowDisabler} class as illustrated in the above example. # Note that a {Wx::BusyInfo} is always built with the {Wx::STAY_ON_TOP} window style (see {Wx::Frame} window styles for more info). # === # # Category: Common Dialogs # class BusyInfo < ::Object # Update the information text. # The text string may contain markup as described in {Wx::Control#set_label_markup}. # @param str [String] # @return [void] def update_text(str) end # Same as {Wx::BusyInfo#update_text} but doesn't interpret the string as containing markup. # @param str [String] # @return [void] def update_label(str) end end # BusyInfo # Parameters for {Wx::BusyInfo}. # This class exists only in order to make passing attributes to {Wx::BusyInfo} constructor easier and the code doing it more readable. # All methods of this class return the reference to the object on which they are called, making it possible to chain them together, e.g. typically you would just create a temporary {Wx::BusyInfoFlags} object and then call the methods corresponding to the attributes you want to set, before finally passing the result to {Wx::BusyInfo} constructor, e.g.: # # wxBusyInfo info # ( # wxBusyInfoFlags() # .Parent(window) # .Icon(icon) # .Title("Some text") # .Text("Some more text") # .Foreground(wxColour(...)) # .Background(wxColour(...)) # ); # class BusyInfoFlags < ::Object # Default constructor initializes all attributes to default values. # Call the other methods to really fill in the object. # @return [BusyInfoFlags] def initialize; end # Sets the parent for {Wx::BusyInfo}. # @param parent [Wx::Window] # @return [Wx::BusyInfoFlags] def parent(parent) end # Sets the icon to show in {Wx::BusyInfo}. # @param icon [Wx::Icon] # @return [Wx::BusyInfoFlags] def icon(icon) end # Sets the title, shown prominently in {Wx::BusyInfo} window. # The title string may contain markup as described in {Wx::Control#set_label_markup}. # @param title [String] # @return [Wx::BusyInfoFlags] def title(title) end # Sets the more detailed text, shown under the title, if any. # The text string may contain markup as described in {Wx::Control#set_label_markup}. # @param text [String] # @return [Wx::BusyInfoFlags] def text(text) end # Same as {Wx::BusyInfoFlags#text} but doesn't interpret the string as containing markup. # This method should be used if the text shown in {Wx::BusyInfo} comes from external source and so may contain characters having special meaning in simple markup, e.g. '<'. # @param label [String] # @return [Wx::BusyInfoFlags] def label(label) end # Sets the foreground colour of the title and text strings. # @param foreground [Wx::Colour,String,Symbol] # @return [Wx::BusyInfoFlags] def foreground(foreground) end # Sets the background colour of {Wx::BusyInfo} window. # @param background [Wx::Colour,String,Symbol] # @return [Wx::BusyInfoFlags] def background(background) end # Sets the transparency of {Wx::BusyInfo} window. # # @see Wx::TopLevelWindow#set_transparent # @param alpha [Integer] Value in {Wx::ALPHA_TRANSPARENT} (0) to {Wx::ALPHA_OPAQUE} (255) range. # @return [Wx::BusyInfoFlags] def transparency(alpha) end end # BusyInfoFlags end