src/hbwidgets/popups/hbmessagebox.cpp
changeset 5 627c4a0fd0e7
parent 3 11d3954df52a
child 6 c3690ec91ef8
equal deleted inserted replaced
3:11d3954df52a 5:627c4a0fd0e7
    48         setReadOnly(true);
    48         setReadOnly(true);
    49         setCursorVisibility(Hb::TextCursorHidden);
    49         setCursorVisibility(Hb::TextCursorHidden);
    50         HbScrollArea *scroll = scrollArea();
    50         HbScrollArea *scroll = scrollArea();
    51         scroll->setVerticalScrollBarPolicy(HbScrollArea::ScrollBarAsNeeded);
    51         scroll->setVerticalScrollBarPolicy(HbScrollArea::ScrollBarAsNeeded);
    52         clearContextMenuFlag(Hb::ShowTextContextMenuOnLongPress);
    52         clearContextMenuFlag(Hb::ShowTextContextMenuOnLongPress);
    53         clearContextMenuFlag(Hb::ShowTextContextMenuOnSelectionClicked);
    53         clearContextMenuFlag(Hb::ShowTextContextMenuOnSelectionClicked);  
    54         primitive(HbStyle::P_LineEdit_frame_normal)->setVisible(false);        
    54         setBackgroundItem(0,0);
    55         primitive(HbStyle::P_LineEdit_frame_highlight)->setVisible(false);        
       
    56     }
       
    57 
       
    58     HbScrollBar * getScrollBar() const
       
    59     {
       
    60         HbScrollArea *scroll = scrollArea();
       
    61         return scroll->verticalScrollBar();
       
    62     }
    55     }
    63 
    56 
    64     void focusInEvent(QFocusEvent * event)
    57     void focusInEvent(QFocusEvent * event)
    65     {
    58     {
    66         Q_UNUSED(event);         
    59         Q_UNUSED(event);         
   156         q->setTimeout(HbPopup::NoTimeout);       
   149         q->setTimeout(HbPopup::NoTimeout);       
   157         q->addAction(new HbAction(q->tr("Yes"),q));
   150         q->addAction(new HbAction(q->tr("Yes"),q));
   158         q->addAction(new HbAction(q->tr("No"),q));
   151         q->addAction(new HbAction(q->tr("No"),q));
   159         break;
   152         break;
   160     }
   153     }
   161 
       
   162 }
   154 }
   163 
   155 
   164 /*!
   156 /*!
   165     @beta
   157     @beta
   166     
   158     
   171     \image html question.PNG  "A question MessageBox"
   163     \image html question.PNG  "A question MessageBox"
   172     \image html warning.PNG  "A warning MessageBox"
   164     \image html warning.PNG  "A warning MessageBox"
   173 
   165 
   174     Using HbMessageBox, the following dialogs can be created:
   166     Using HbMessageBox, the following dialogs can be created:
   175 
   167 
   176     <b>Information:</b> a statement to the user to which they may respond by acknowledging the information ('OK').<br>
   168     <b>Information:</b> a statement to the user to which dismissed after acknowledging the information ('OK').<br>
   177     <b>Question:</b> a query to the user requiring a response. User needs to select between two alternatives, the positive or negative (For example: 'Delete Mailbox?' 'Yes'/'No').<br>
   169     <b>Question:</b> a query to the user requiring a response. User needs to select between two alternatives, the positive or negative (For example: 'Delete Mailbox?' 'Yes'/'No').<br>
   178     <b>Warning:</b> a statement to the user to which they may respond by acknowledging the warning ('OK').<br>
   170     <b>Warning:</b> a statement to the user to which they may respond by acknowledging the warning ('OK').<br>
   179     
   171     
   180     By default, Message box launches an information dialog which contains a description text and user actions visualized as command buttons.
   172     By default, Message box launches an information dialog which contains a description text and user actions visualized as command buttons.
   181 
   173 
   182     Default properties for the MessageBox (warning, information and question dialogs) are:
   174     Default properties for the MessageBox (warning, information and question dialogs) are:
   183 
   175 
   184     Description text: Text shown to the user as information. The amount of text rows is not limited, but after five rows the text starts scrolling.
   176     Description text: Text shown to the user as information. The amount of text rows is not limited, but after five rows the text starts scrolling.
   185     Icon: Default icons are available for each dialog type using the MessageBox template. Changing the default icons is not recommended.
   177     Icon: Default icons are available for each dialog type using the MessageBox template.
   186     Action buttons (one or two): one button for information and warning MessageBox, two buttons for question MessageBox.
   178     Action buttons (one or two): one button for information and warning MessageBox, two buttons for question MessageBox.
   187     
   179     
   188     All the three dialogs(information, warning, question) supported by MessageBox are by default modal in nature, with
   180     All the three dialogs(information, warning, question) supported by MessageBox are by default modal in nature, with
   189     a dismiss policy of NoDismiss, timeout policy of NoTimeout, and with a BackgroundFade property on.
   181     a dismiss policy of NoDismiss, timeout policy of NoTimeout, and with a BackgroundFade property on.
   190     The user must click the OK/Yes/No buttons to dismiss the Message Box.
   182     The user must click the OK/Yes/No buttons to dismiss the Message Box.