Poprawki XUL w Firefoksie 3
z Mozilla Developer Center, polskiego centrum programistów Mozilli.
UWAGA: Tłumaczenie tej strony nie zostało zakończone.
Może być ona niekompletna lub wymagać korekty.
Chcesz pomóc? | Dokończ tłumaczenie | Sprawdź ortografię | Więcej takich stron...
Ten artykuł obejmuje funkcje wprowadzone w Firefoksie 3
Firefox 3 oferuje kilka nowych elementów XUL, jak również poprawki do już isntniejących elementów. Mimo iż ten materiał jest udokumentowany gdzie indziej, ten artykuł dostarcza dogodną listę wyżej wspomnianych poprawek jak i linki do dokładnej dokumentacji.
Spis treści |
[edytuj] Nowe elementy
- Kontrolki numeryczne:
- Nowy element
<scale>pozwala na tworzenie ruchomych skali, które pozwalają użytkownikowi wybrać jaką kolwiek wartość w określonym zakresie. Ten gadżet mógłby by być używany, dla przykładu, do tworzenia regulacji głośności dzwięku. - Nowa wartość ,
number, dla atrybututypedla textboxes tworzy okienko tekstowe w którym może zostać tylko wprowadzone cyfry. Dodatkowo, pojawiają się przyciski w kształcie strzałek z obu stron co może zostać użyte do przemieszczania się pomiędzy wartościami. Więcej informacji na temat numerycznych okienek tekstowych(błąd 345510) - Element
<spinbuttons>został dodany który może zostać użyty prz tworzeniu gadżetów za pomocą wiązań XBL (błąd 155053) - Dwa gadżety,
<datepicker>i<timepicker>, mogą zostać użyte\ aby zezwolić wprowadzenie dat i czasów. datepicker jest dostępny w licznych stylach poprzez ustawienie atrybututype, aby zezwolić wpis okienek tekstowych lub siatki kalendarzowych. Więcej informacji na temat date pickers Referencje dla Datepicker Referencje dla Timepicker
- Nowy element
- Stworzono przewodnik dla menu i popup-ów opisujący nowe dostępne funkcje:
- Element
<dropmarker>jest pomocny przy tworzeniu menu podobnych gadżetów za pomocą wiązań XBL. (błąd 348614) - Element
<panel>jest nowy i zaprojektowany dla popup-ów które nie znajdują się w menu.Mogą obsługiwać jakikolwiek typ zawartości. Element <menupopup> powinien byc używany dla menu. Menu dają możliwość nawigacji klawiaturą i obsługują otwieranie i zamykanie podmenu.
- Element
[edytuj] Poprawki drzewek
- Teraz drzewka mogą być skrolowane horyzontalnie. Jeżeli kolumny nie mieszczą się w dostępnej szerokości, pojawia się horyzontalny suwak skrolowania. Tak się dzieje jeżeli określone szerokości kolumny zajmują więcej niż jest dostępnego miejsca. Zobacz błąd 212789 ,aby dowiedzieć się o szczegółach.
- Nowy styl selekcjonowania pozwala na wybieranie pojedynczych komórek zamiast całych rzędów. Aby użyć tego stylu selekcjonowania, ustaw atrybut drzewek
seltypedocell. - Teraz drzewka obsługują edytowanie pojedyńczych komórek. Kiedy użytkonik podwójnie kliknie na edytowalną komórkę, pojawi się pole tekstowe w którym użytkownik może edytować zawartość danej komórki. Zobacz te notatki ,aby dowiedzieć się o szczegółach.
- Teraz element <treecol> obsługuje atrybut
overflowktórego wartość logiczna może być ustawiona na prawdę, aby zezwolić,gdy tekst jest za duży żeby zmieścić się w pojedynczej komórce, tekstowi komórek wewnątrz kolumny na rozszerzanie się na sąsiadujące puste komórki.
[edytuj] Poprawki menu
- The
imageattribute is now used consistently for setting images. - Menulists fire the
selectevent when selecting an item. - The
inputFieldandeditableproperties have been added to menulist - The
<menu>,<menuitem>and<menuseparator>elements now have a readonlyselectedproperty which retrieves whether the item is selected in a <menulist> - The
<menu>,<menuitem>and<menuseparator>elements now have a readonlycontrolproperty which returns the enclosing <menulist> - The
<menu>,<menuitem>and<menuseparator>elements now support theaccessKey,disabled,crop,imageandlabelproperties which set the corresponding attribute - The <menu> element now has methods to append, insert and remove menuitems. (błąd 372552)
- Editable menulists now offer an
editorproperty to get the internalnsIEditorfor its text field. - Menus may now be made translucent on platforms that support it (błąd 70798).
[edytuj] Poprawki textbox
- Setting a textbox's
spellcheckattribute totrueenables inline spellchecking for that textbox. - The
<textbox>now has areset()method to reset the value of the textbox to the default value. ThedefaultValueproperty may be used to retrieve and modify the default value of the textbox. - An
editorproperty is now offered, which lets you get the internalnsIEditorfor the text field. textboxnow supports anewlinesattribute which specifies how line breaks in pasted text are handled. Possible values are:pasteintact- paste everything as ispastetofirst- (default value) paste only up to the first line breakreplacewithspaces- replace line breaks with spacesreplacewithcommas- replace line breaks with commasstrip- strip out all line breaksstripsurroundingwhitespace- strip out all line breaks and surrounding whitespace
[edytuj] Inne poprawki
- The
typeattribute on a<button>may be set torepeatto create buttons which fire their command event repeatedly while the mouse button is held down. - The
buttondisabledacceptattribute can now be used on the<dialog>element to have the accept (OK) button initially disabled. - The
<titlebar>element now supports thealloweventsattribute to allow events to be passed to the children of the titlebar. - The
<splitter>now supports an additional value for thecollapseattribute of'both'which indicates that the splitter can collapse elements on both sides of it when dragged. Thesubstateattribute will set to either before or after when one is collapsed. (błąd 337955) - The
<richlistbox>element now supports multiple selection. Set theseltypeattribute to'multiple'to enable this. - The
<radio>element has agroupattribute which may be set to the id of a<radiogroup>element which the radio button belongs to. This allows the radio buttons to arranged in a manner that may not be as suitable when placing them all inside a radiogroup. - Menus, panels and tooltips support two additional methods,
openPopup()andopenPopupAtScreen(). These methods should be used instead ofshowPopup()which was found to be confusing to use. - Handling of the
<key>element improved for non-Latin keyboard layout users. See Gecko Keypress Event. - On Mac OS X, the activetitlebarcolor and inactivetitlebarcolor attributes of the root elements (
<window>,<dialog>,<prefwindow>and<wizard>) are available to customize the color of the windows' title bars.