Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: Hide navigation bar when using MessageDlg



Permlink Replies: 5 - Last Post: Nov 23, 2016 3:58 AM Last Post By: Dagmara Niedzwi...
Dagmara Niedzwi...

Posts: 7
Registered: 7/24/16
Hide navigation bar when using MessageDlg
Click to report abuse...   Click to reply to this thread Reply
  Posted: Sep 22, 2016 7:15 AM
Hi all,

My application is full screen all the time exclusive when the Message box appears. How can I hide the navigation bar during showing message box? I am using MessageDlg in my application.

Thanks
Dagmara

Edited by: Dagmara Niedzwiecka on Sep 22, 2016 7:30 AM
Sebastian Ledesma

Posts: 78
Registered: 11/9/00
Re: Hide navigation bar when using MessageDlg
Click to report abuse...   Click to reply to this thread Reply
  Posted: Sep 26, 2016 11:05 PM   in response to: Dagmara Niedzwi... in response to: Dagmara Niedzwi...
As I know you have to configure your Android device in 'kiosk mode'.
John Stolczyk

Posts: 8
Registered: 9/18/16
Re: Hide navigation bar when using MessageDlg
Click to report abuse...   Click to reply to this thread Reply
  Posted: Sep 30, 2016 3:33 AM   in response to: Dagmara Niedzwi... in response to: Dagmara Niedzwi...
Dagmara Niedzwiecka wrote:
Hi all,

My application is full screen all the time exclusive when the Message box appears. How can I hide the navigation bar during showing message box? I am using MessageDlg in my application.

Thanks
Dagmara

Serwus Dagmara.

You can hide Navigation Bar using hideSystemUI() function that is the subfunction of MainActivity() (you need to #include <FMX.Platform.Android.hpp>), but usually it ends up with the Status Bar overlapping main Form, so you also must hide the Status Bar using MainActivity()->hideStatusBar()
Also you need to call this metod in the UI thread, so finally the code for hiding/showing nav and status bar will look like this:

CallInUIThread([](){
	 MainActivity()->hideSystemUI(); //hides nav bar
	 MainActivity()->hideStatusBar(); //hides status bar
 
	 MainActivity()->showStatusBar(); //shows status bar
	 MainActivity()->showSystemUI(); //hides nav bar
	});
Dagmara Niedzwi...

Posts: 13
Registered: 11/15/15
Re: Hide navigation bar when using MessageDlg
Click to report abuse...   Click to reply to this thread Reply
  Posted: Nov 22, 2016 8:32 AM   in response to: John Stolczyk in response to: John Stolczyk
Sorry but I don't know how to use CallInUIThread in C++ Builder. I got error:"[bccaarm Error] Unit3.cpp(18): use of undeclared identifier 'CallInUIThread'".

John Stolczyk wrote:
Dagmara Niedzwiecka wrote:
Hi all,

My application is full screen all the time exclusive when the Message box appears. How can I hide the navigation bar during showing message box? I am using MessageDlg in my application.

Thanks
Dagmara

Serwus Dagmara.

You can hide Navigation Bar using hideSystemUI() function that is the subfunction of MainActivity() (you need to #include <FMX.Platform.Android.hpp>), but usually it ends up with the Status Bar overlapping main Form, so you also must hide the Status Bar using MainActivity()->hideStatusBar()
Also you need to call this metod in the UI thread, so finally the code for hiding/showing nav and status bar will look like this:

CallInUIThread([](){
	 MainActivity()->hideSystemUI(); //hides nav bar
	 MainActivity()->hideStatusBar(); //hides status bar
 
	 MainActivity()->showStatusBar(); //shows status bar
	 MainActivity()->showSystemUI(); //hides nav bar
	});
Remy Lebeau (Te...


Posts: 9,447
Registered: 12/23/01
Re: Hide navigation bar when using MessageDlg
Click to report abuse...   Click to reply to this thread Reply
  Posted: Nov 22, 2016 10:02 AM   in response to: Dagmara Niedzwi... in response to: Dagmara Niedzwi...
Dagmara wrote:

Sorry but I don't know how to use CallInUIThread in C++ Builder. I
got error:"[bccaarm Error] Unit3.cpp(18): use of undeclared identifier
'CallInUIThread'".

CallInUIThread() is declared in FMX.Helpers.Android.hpp.

--
Remy Lebeau (TeamB)
Dagmara Niedzwi...

Posts: 13
Registered: 11/15/15
Re: Hide navigation bar when using MessageDlg
Click to report abuse...   Click to reply to this thread Reply
  Posted: Nov 23, 2016 3:58 AM   in response to: Remy Lebeau (Te... in response to: Remy Lebeau (Te...
Thank you but navigation bars still are visible. Maybe I am using this function in wrong way. this is my example code:

void __fastcall TForm3::Button3Click(TObject *Sender)
{
CallInUIThread([](){
MainActivity()->hideSystemUI(); //hides nav bar
MainActivity()->hideStatusBar(); //hides status bar
});

struct TCloseDialogHandler : public TCppInterfacedObject<TInputCloseDialogProc> {

void __fastcall Invoke(const System::Uitypes::TModalResult AResult) {

switch (AResult) {
case mrYes :
ShowMessage("You chose Yes");
break;
case mrNo:
ShowMessage("You chose No");
break;
case mrCancel:
ShowMessage("You chose Cancel");
break;
}
}
};
_di_TInputCloseDialogProc handler = new TCloseDialogHandler();
/* Show a multiple-button alert that triggers different code blocks according to
your input */
MessageDlg("Choose a button:", TMsgDlgType::mtInformation,
TMsgDlgButtons() << TMsgDlgBtn::mbYes << TMsgDlgBtn::mbNo << TMsgDlgBtn::mbCancel , 0, handler);
}

Remy Lebeau (TeamB) wrote:

CallInUIThread() is declared in FMX.Helpers.Android.hpp.

--
Remy Lebeau (TeamB)
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02