XUL Textbox inside Popup not working - textbox

I am working on creating a Firefox extension. I have added a textbox inside a popup. The popup opens on clicking on a toolbar button. The textbox is appearing but does not let me edit it. I have not given any read only attributes.
Here is the code:
<popupset id="myPopupSet">
<popup id="trial-popup" noautohide="true" position="after_start">
<vbox>
<label value="Enter your name:"/>
<textbox id="identfier_box" value="This is some text."/>
</vbox>
</popup>
</popupset>
<toolbarpalette id="BrowserToolbarPalette">
<toolbarbutton id="mybutton"
class="toolbarbutton-1"
label="Identifier"
popup="trial-popup"
insertbefore="urlbar-container" />
can anyone let me know why there is this problem?
Thanks!

What you really want is a panel and not a popup.
Change <popup> to <panel> and you have what you want.

Related

.Net MAUI - Shell Navigation Back Button Title (iOS)

I have noticed one issue in Shell Navigation title. When setting ContentPage's Title property it shows same text with Back button also. Used NavigationPage.BackButtonTitle property as well from xaml still its not working.
For Example:
HomePage.xaml
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="Switch_Bug.HomePage"
NavigationPage.BackButtonTitle="Back"
Title="Home Page">
<VerticalStackLayout>
<Label
Text="Welcome to .NET MAUI!"
VerticalOptions="Center"
HorizontalOptions="Center" />
</VerticalStackLayout>
</ContentPage>
Result:
Expected result:
In iOS, it should Back Button text as "Back" otherwise just show the back button. But it shows the page's title text.
Update 02/02/2023
The main issue is if the title of the page is short then it will show the same with the back button and if the title is long enough then it will work fine.
The same issue was reported on the MAUI git repo as well. https://github.com/dotnet/maui/issues/11691
First of all, I believe BackButtonTitle will only work for iOS since Android does not use "back titles"
Second, the BackButtonTitle might be slightly counterintuitive, but it is the title that will be displayed on a further page that navigates back to the page you defined in on. In your case, setting the BackButtonTitle on your HomePage to "back" does not set the back button on the HomePage to "back"; it will set the back button to "back" on any page that has a back navigation to the HomePage. Hope that makes sense.
NavigationPage.BackButtonTitle is applicable to Navigation.PushAsync in NavigationPage, but not in Shell. There is a corresponding method in Shell’s navigation to change the text of the back button. I did a simple test, and you can modify your code as follows:
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="Switch_Bug.HomePage"
Title="Home Page">
<VerticalStackLayout>
<Label
Text="Welcome to .NET MAUI!"
VerticalOptions="Center"
HorizontalOptions="Center" />
</VerticalStackLayout>
<Shell.BackButtonBehavior>
<BackButtonBehavior TextOverride="Back" />
</Shell.BackButtonBehavior>
</ContentPage>
For more details, you can refer to the official documentation:.NET MAUI Shell navigation

How to enable or disable the buttons in windows phone 7?

My Design has the following lines of code:
<Button BorderThickness="0" Content="Done" FontSize="21.333" Height="65" Margin="334,13,6,0" VerticalAlignment="Top" FontFamily="Times New Roman" Name="btnConvert" >
<Button.Background>
<ImageBrush ImageSource="Images/button_back2.png" />
</Button.Background>
</Button>
My code goes btnConvert.IsEnabled = false;.
It can't disable the button. Instead, it hides the button. I need that button to be visible but disabled. Please help me.
Isenabled works for me. try your xaml code in some xaml viewer to check if you are not doing anything wrong
This is what I usually do:
`btnConvert.IsHitTestVisible = false;`
It will disable the button, but you can see the button with the same colors at beginning.

How I can find MouseClick or GotFocus event in PivotItem.?

Hello How I can find GotFocus event into the PivotItem I had tired with GalaSoft Interaction with Triger and EventName="GotFocus" but it is not fired can anybody help me to find the PivioItem Event.
Thank you.
the pivot item gets focus upon cliking any control placed inside that pivot item.
<controls:PivotItem Header="item1">
<i:Interaction.Triggers>
<i:EventTrigger EventName="GotFocus">
<i:InvokeCommandAction Command="{Binding ShowMessageCommand}" />
</i:EventTrigger>
</i:Interaction.Triggers>
<Grid>
<TextBox Height="100"
Width="200"/>
<Button Height="100"
Width="200" />
</Grid>
</controls:PivotItem>
This code works for me. the pivot item get focus upon clicking the button or the text box.
Hope this helps you.
Yes,
here you are the solution:
<controls:Pivot Title="My Pivot">
<i:Interaction.Triggers>
<i:EventTrigger EventName="SelectionChanged">
<i:InvokeCommandAction Command="{Binding EuropePivotSelectedCommand}" />
</i:EventTrigger>
</i:Interaction.Triggers>
<controls:PivotItem Header="item1">
</controls:PivotItem>
<controls:PivotItem Header="item2">
</controls:PivotItem>
Regards
Juanlu, ElGuerre

tooltip not working

I'm using this code in *.xul
<tooltip id="tt">
<label value="additional information"/>
</tooltip>
<statusbar id="status-bar">
<statusbarpanel id="mypanel" tooltip="tt"
label="my panel"
/>
</statusbar>
I don't know why but when I'm over mypanel with mouse. There is no popup window with "additional information"
thank you for help
I'm not sure, but this might be because the <tooltip> element needs to be inside of a <popupset> element. By the way, you shouldn't use the statusbar anymore; use the add-on bar instead: https://developer.mozilla.org/en/The_add-on_bar

how to handler preference and interface of mozilla firefox addons?

I want to ask some questions:
What steps should I do to make the interface on mozilla firefox and handle all these interfaces.
interfaces that I want to make are:
status bar that consists of labels and pictures and if the status bar on the right click menu will display the active addons (addons menu inactive hidden) and preferences.
current web page on the right click, on the browser will display a context menu "terjemahkan" and there are pictures on the left-hand corner.
when I select the options button on the tools menu >> addons, users can adjust these addons settings with the radio buttons
when the context menu is selected then the browser window will show the desired results
the steps that I have done is:
i was made the status bar but why the picture I want not to appear when I've made as directed. as well as on the context menu, the image can not appear in the upper left corner of the menu like in general.
<?xml version="1.0"?>
<overlay id="inline_trans"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
xmlns:html="http://www.w3.org/1999/xhtml">
<!--
<script type="application/x-javascript" src="chrome://translator/content/script.js" />
<script type="application/x-javascript" src="chrome://translator/content/interface.js" />
-->
<!-- menu klik kanan pada halaman web -->
<popup id="contentAreaContextMenu">
<menuseparator />
<menuitem id="intransContextMenuPage"
image="chrome://inlinetrans/skin/imagesOn_kecil.png"
label="terjemahkan dengan intrans"
oncommand="inline.script.getText()" />
</popup>
<!-- pilihan menu pada status bar -->
<popupset>
<menupopup id="intransContextMenu">
<menuitem label="intrans nonaktif"
image="chrome://inlinetrans/skin/imagesOff_kecil.png"
hidden="true"/>
<menuitem label="intrans aktif"
image="chrome://inlinetrans/skin/imagesOn_kecil.png"
hidden="false"/>
<menuseparator />
<menuitem label="preferensi"/>
</menupopup>
</popupset>
<!-- ========================================= -->
<!-- statusbar-->
<statusbar id="status-bar">
<statusbarpanel id="status-bar-intrans"
image="chrome://inlinetrans/skin/imagesOn_kecil.png"
label="intrans"
context="intransContextMenu"
tooltiptext="intrans versi 1.0"
/>
</statusbar>
</overlay>
UI options preferences
<?xml version="1.0"?>
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<!DOCTYPE overlay SYSTEM "chrome://inlinetrans/locale/options.dtd">
<dialog xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
id="translate-preferences"
title="&options.title;"
buttons="accept, cancel"
style="padding:0px; margin:0px;"
ondialogaccept="options.save()"
onload="options.init();"
onunload="options.deconstruct();">
<!--
<stringbundleset id="stringbundleset">
<stringbundle id="locale-properties" src="chrome://translator/locale/translator.properties"/>
<stringbundle id="properties" src="chrome://translator/content/translator.properties"/>
</stringbundleset>
-->
<!--
<script src="chrome://inlinetrans/content/options.js" />
-->
<description value="&options.desc;"
style="
background: #fff url('chrome://inlinetrans/skin/options.png') no-repeat;
min-width:400px;
min-height:40px;
padding-left:55px;
padding-top:10px;
margin:0px;
border-bottom: 2px solid #757575;
font-size:1.5em;"/>
<vbox style="padding:10px;">
<groupbox>
<caption label="&options.ui;"/>
<label value="&options.results.desc;"/>
<radiogroup id="display.results" style="padding-left:20px;">
<radio id="results.cat" value="category" label="&options.results.cat;"/>
<radio id="results.noncat" value="noncategory" label="&options.results.noncat;"/>
</radiogroup>
</groupbox>
</vbox>
</dialog>
The most confusing thing for me is how I do all the handler interface.
for example:
change the status of addons, from active to inactive
take the value of the selected radio button
I cannot give you an answer to all of your questions, partly because I don't know exactly what you want, but here is a start:
To show an image next to the menu item, you have to give the element the class menuitem-iconic as described in the documentation:
<menuitem id="intransContextMenuPage"
class="menuitem-iconic"
image="chrome://inlinetrans/skin/imagesOn_kecil.png"
label="terjemahkan dengan intrans"
oncommand="inline.script.getText()" />
I'm not sure for the statusbar, by I would follow the description in the documentation:
The following classes may be used to style the element. These classes should be used instead of changing the style of the element directly since they will fit more naturally with the user's selected theme.
statusbarpanel-iconic
Use this class to have an image appear on the statusbarpanel. Specify the image using the src attribute. The image will appear instead of the label.
You can get the value of the selected radio button by getting a reference to the radiogroup,access its property selectedItem which gives you a radio element and read the value property:
var value = document.getElementById('display.results').selectedItem.value;

Resources