Mini Kabibi Habibi
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using DevExpress.XtraBars;
namespace DevExpress.Tutorials.XtraEditors {
public partial class FrmMainXtraEditors : DevExpress.Tutorials.FrmMainTreeViewReg {
public FrmMainXtraEditors()
: base() {
InitializeComponent();
defaultLookAndFeel.LookAndFeel.StyleChanged += new EventHandler(LookAndFeel_StyleChanged);
}
internal BarManager Manager { get { return barManager1; } }
void LookAndFeel_StyleChanged(object sender, EventArgs e) {
tvNavigation.ExpandAll();
}
string languageDir = "CS\\";
Image GetImageFromResources(string name) {
try {
System.IO.Stream str = System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream("EditorsTutorials.Images." + name);
return Image.FromStream(str);
}
catch {
return null;
}
}
string GetXmlFileByName(string name) {
return "Data\\Tutorials\\XtraEditors\\" + name;
}
string GetFileNameByName(string name) {
string[] fileNames = name.Split(new char[] { ';' });
string codePath = "EditorsTutorials\\Modules\\";
string codeFile = DevExpress.Utils.FilesHelper.FindingFileName(Application.StartupPath, codePath + fileNames[0], false);
if(codeFile == "") codePath = languageDir + codePath;
string resultString = string.Empty;
foreach(string fileName in fileNames) {
resultString += ";" + codePath + fileName;
}
return resultString.Substring(1);
}
protected override void InitModuleInformation() {
this.imageListTreeView.Images.Add(GetImageFromResources("category.gif"), Color.Magenta);
AddModuleInfo(0, -1, "Welcome", string.Empty, typeof(ModuleWelcome));
AddModuleInfo(1, -1, "No text box", string.Empty, null);
AddModuleInfo(2, 1, "CheckEdit", GetImageFromResources("check_edit.gif"), typeof(ModuleCheckEdit),
"This tutorial demonstrates a CheckEdit editor that has checked, unchecked and, optionally, grayed states. It's most commonly used to edit Boolean values.", GetXmlFileByName("checkEdit.xml"), GetFileNameByName("ModuleCheckEdit.cs"));
AddModuleInfo(3, 1, "ProgressBar (updated)", GetImageFromResources("progressbar.gif"), typeof(ModuleProgressBar),
"This tutorial demonstrates a ProgressBarControl. It's most commonly used to indicate the progress of a lengthy operation.", GetXmlFileByName("progressBar.xml"), GetFileNameByName("ModuleProgressBar.cs"));
AddModuleInfo(4, 1, "RadioGroup", GetImageFromResources("radio_group.gif"), typeof(ModuleRadioGroup),
"This tutorial demonstrates a RadioGroup editor which provides a group of radio buttons. It allows a user to select one of several options.", GetXmlFileByName("radioGroup.xml"), GetFileNameByName("ModuleRadioGroup.cs"));
AddModuleInfo(5, 1, "PictureEdit", GetImageFromResources("picture_edit.gif"), typeof(ModulePictureEdit),
"This tutorial demonstrates a PictureEdit editor which is used to display images stored as a bitmap, metafile, icon, JPEG, GIF or PNG.", GetXmlFileByName("pictureEdit.xml"), GetFileNameByName("ModulePictureEdit.cs"));
AddModuleInfo(6, -1, "Text Box Editors", string.Empty, null);
AddModuleInfo(8, 6, "TextEdit", GetImageFromResources("text_edit.gif"), typeof(ModuleTextEdit),
"This tutorial demonstrates a TextEdit � a single-line text editor.", GetXmlFileByName("textedit.xml"), GetFileNameByName("ModuleTextEdit.cs"));
AddModuleInfo(11, 6, "ButtonEdit", GetImageFromResources("button_edit.gif"), typeof(ModuleButtonEdit),
"This tutorial demonstrates a ButtonEdit editor which lets you display an unlimited number of buttons within the edit box.", GetXmlFileByName("buttonedit.xml"), GetFileNameByName("ModuleButtonEdit.cs;ButtonProperties.cs"));
AddModuleInfo(12, 6, "HyperLinkEdit", GetImageFromResources("hyperlink_edit.gif"), typeof(ModuleHyperLinkEdit),
"This tutorial demonstrates a HyperLinkEdit editor which lets you edit hyperlinks and navigate to their targets.", GetXmlFileByName("hyperlinkedit.xml"), GetFileNameByName("ModuleHyperLinkEdit.cs"));
AddModuleInfo(13, 6, "MemoEdit", GetImageFromResources("memo_edit.gif"), typeof(ModuleMemoEdit),
"This tutorial demonstrates a MemoEdit editor which enables multi-line text to be displayed and edited.", GetXmlFileByName("memoedit.xml"), GetFileNameByName("ModuleMemoEdit.cs"));
AddModuleInfo(10, -1, "Spin Editors", string.Empty, null);
AddModuleInfo(7, 10, "SpinEdit", GetImageFromResources("spin_edit.gif"), typeof(ModuleSpinEdit),
"This tutorial demonstrates a SpinEdit editor which allows numeric values to be edited using spin buttons.", GetXmlFileByName("spinedit.xml"), GetFileNameByName("ModuleSpinEdit.cs"));
AddModuleInfo(9, 10, "TimeEdit (updated)", GetImageFromResources("time_edit.gif"), typeof(ModuleTimeEdit),
"This tutorial demonstrates a TimeEdit editor which allows time values to be edited using spin buttons.", GetXmlFileByName("timeedit.xml"), GetFileNameByName("ModuleTimeEdit.cs"));
AddModuleInfo(14, -1, "Popup Editors", string.Empty, null);
AddModuleInfo(15, 14, "CalcEdit", GetImageFromResources("calc_edit.gif"), typeof(ModuleCalcEdit),
"This tutorial demonstrates a CalcEdit editor which provides a dropdown calculator. Using the dropdown calculator, you can perform basic calculations such as addition, multiplication, getting the inverse of a number and working with a memory register etc.", GetXmlFileByName("calcedit.xml"), GetFileNameByName("ModuleCalcEdit.cs"));
AddModuleInfo(16, 14, "ColorEdit", GetImageFromResources("color_edit.gif"), typeof(ModuleColorEdit),
"This tutorial demonstrates a ColorEdit editor which allows you to select a color from the dropdown window. The dropdown contains three tabbed pages displaying predefined custom, web and system colors.", GetXmlFileByName("coloredit.xml"), GetFileNameByName("ModuleColorEdit.cs"));
AddModuleInfo(38, 14, "ColorPickEdit", GetImageFromResources("colorpick_edit.gif"), typeof(ModuleColorPickEdit),
"This tutorial demonstrates a ColorEdit editor which allows you to select a color from the dropdown window. The dropdown contains three tabbed pages displaying predefined custom, web and system colors.", GetXmlFileByName("coloredit.xml"), GetFileNameByName("ModuleColorPickEdit.cs"));
AddModuleInfo(17, 14, "ComboBoxEdit", GetImageFromResources("combobox_edit.gif"), typeof(ModuleComboBoxEdit),
"This tutorial demonstrates a ComboBoxEdit editor which allows you to select the predefined items from the dropdown list.", GetXmlFileByName("comboboxedit.xml"), GetFileNameByName("ModuleComboBoxEdit.cs"));
AddModuleInfo(18, 14, "DateEdit (updated)", GetImageFromResources("date_edit.gif"), typeof(ModuleDateEdit),
"This tutorial demonstrates a DateEdit editor which allows date/time values to be edited using a dropdown calendar.", GetXmlFileByName("dateedit.xml"), GetFileNameByName("ModuleDateEdit.cs"));
AddModuleInfo(19, 14, "ImageComboBoxEdit", GetImageFromResources("imagecombobox_edit.gif"), typeof(ModuleImageComboBoxEdit),
"This tutorial demonstrates an ImageComboBoxEdit editor. This editor represents a combo box editor whose items can display custom images.", GetXmlFileByName("imagecomboboxedit.xml"), GetFileNameByName("ModuleImageComboBoxEdit.cs"));
AddModuleInfo(20, 14, "ImageEdit", GetImageFromResources("image_edit.gif"), typeof(ModuleImageEdit),
"This tutorial demonstrates an ImageEdit editor which displays images (bitmap, metafile, icon, JPEG, GIF or PNG file) in its popup window.", GetXmlFileByName("imageedit.xml"), GetFileNameByName("ModuleImageEdit.cs"));
AddModuleInfo(21, 14, "LookUpEdit", GetImageFromResources("lookup_edit.gif"), typeof(ModuleLookUpEdit),
"This tutorial demonstrates a LookUpEdit editor which is used to display a multi-column record list from an associated data source.", GetXmlFileByName("lookupedit.xml"), GetFileNameByName("ModuleLookUpEdit.cs;LookUpProperties.cs;Contacts.cs"));
AddModuleInfo(22, 14, "MemoExEdit", GetImageFromResources("memoex_edit.gif"), typeof(ModuleMemoExEdit),
"This tutorial demonstrates a MemoExEdit editor which allows multi-line text to be edited in its popup window.", GetXmlFileByName("memoeditex.xml"), GetFileNameByName("ModuleMemoExEdit.cs"));
AddModuleInfo(23, 14, "MRUEdit", GetImageFromResources("mru_edit.gif"), typeof(ModuleMRUEdit),
"This tutorial demonstrates a MRUEdit editor which allows the most recently entered value to be chosen from the dropdown list.", GetXmlFileByName("mruedit.xml"), GetFileNameByName("ModuleMRUEdit.cs"));
AddModuleInfo(24, 14, "PopupContainerEdit", GetImageFromResources("popupcontainer_edit.gif"), typeof(ModulePopupContainerEdit),
"This tutorial demonstrates a PopupContainerEdit editor which is used to display custom controls within its popup window. You must additionally create a PopupContainerControl control which will represent the popup window. You can place any control onto the popup container control. To display the control's contents within an editor's popup window, you should set the editor's PopupControl property to this control.", GetXmlFileByName("popupcontaineredit.xml"), GetFileNameByName("ModulePopupContainerEdit.cs"));
AddModuleInfo(25, -1, "Controls", string.Empty, null);
AddModuleInfo(37, 25, "DropDown Button", GetImageFromResources("dropdownbutton.gif"), typeof(ModuleDropDownButton), "This tutorial demonstrates the DropDownButton control - a button that can be associated with a popup control or a context menu. You can invoke the associated control by clicking the button's drop-down arrow, or the button itself (if the arrow is hidden).", GetXmlFileByName("dropdownbutton.xml"), GetFileNameByName("ModuleDropDownButton.cs"));
AddModuleInfo(26, 25, "DataNavigator", GetImageFromResources("data_navigator.gif"), typeof(ModuleNavigator),
"This tutorial demonstrates a DataNavigator control which provides a graphical interface to navigate and manipulate the records in a data source.", GetXmlFileByName("navigator.xml"), GetFileNameByName("ModuleNavigator.cs"));
AddModuleInfo(27, 25, "MaskBox", GetImageFromResources("mask_box.gif"), typeof(ModuleMaskBox),
"This tutorial demonstrates how to use masks during editing. Masks provide restricted data input as well as formatted data output. This can be useful when the entered string should match a specific format.", GetXmlFileByName("maskbox.xml"), GetFileNameByName("ModuleMaskBox.cs;MaskProperties.cs"));
AddModuleInfo(28, 25, "ListBoxes", GetImageFromResources("list_boxes.gif"), typeof(ModuleListBox),
"This tutorial demonstrates a ListBoxControl which is used to display a list of items that a user can select.", GetXmlFileByName("listbox.xml"), GetFileNameByName("ModuleListBox.cs;ListBoxProperties.cs"));
AddModuleInfo(29, 25, "ToolTipController", GetImageFromResources("tooltipcontroller.gif"), typeof(ModuleToolTipController),
"This tutorial demonstrates the functionality of the ToolTipController component which manages tooltips for controls.", GetXmlFileByName("tooltipcontroller.xml"), GetFileNameByName("ModuleToolTipController.cs;ToolTipControllerContentProperties.cs"));
AddModuleInfo(30, 1, "Marquee Progress", GetImageFromResources("marquee_progressbar.gif"), typeof(ModuleMarqueeProgressBar),
"This tutorial demonstrates a MarqueeProgressBarControl. It's most commonly used to indicate that an operation is going on by continuously scrolling a block from left to right.", GetXmlFileByName("marqueeProgressBar.xml"), GetFileNameByName("ModuleMarqueeProgressBar.cs"));
AddModuleInfo(31, 1, "TrackBar", GetImageFromResources("trackbar.gif"), typeof(ModuleTrackBar),
"This tutorial demonstrates a TrackBarControl. This is a scrollable control which is used to slide a small thumb along a continuous line.", GetXmlFileByName("trackBar.xml"), GetFileNameByName("ModuleTrackBar.cs"));
AddModuleInfo(32, 1, "RangeTrackBar", GetImageFromResources("rangetrackbar.gif"), typeof(ModuleRangeTrackBar),
"This tutorial demonstrates the RangeTrackBarControl that allows the range of values to be specified. Use the editor's Value property to specify the minimum and maximum limits of the range.", GetXmlFileByName("rangetrackBar.xml"), GetFileNameByName("ModuleRangeTrackBar.cs"));
AddModuleInfo(33, 14, "FontEdit", GetImageFromResources("font_edit.gif"), typeof(ModuleFontEdit),
"This tutorial demonstrates the FontEdit control. The editor allows an end-user to select a specific font by picking up from among all available fonts. After a font has been selected, it's added to the list, which contains the most recently used fonts, and these are listed at the top of the editor's dropdown. Practice selecting fonts and customizing the length of the MRU font list.", GetXmlFileByName("fontEdit.xml"), GetFileNameByName("ModuleFontEdit.cs"));
AddModuleInfo(36, 14, "CheckedComboBox", GetImageFromResources("checkedcombobox_edit.gif"), typeof(ModuleCheckedComboBoxEdit),
"This tutorial demonstrates the CheckedComboBoxEdit control that allows you to display and edit a set of Boolean options or bit fields in a popup window", GetXmlFileByName("checkedcomboboxEdit.xml"), GetFileNameByName("ModuleCheckedComboBoxEdit.cs"));
AddModuleInfo(34, 1, "ZoomTrackBar", GetImageFromResources("zoomtrackbar.gif"), typeof(ModuleZoomTrackBar),
"This tutorial demonstrates a ZoomTrackBarControl. This control emulates the Zoom track bar introduced in MS Office 2007. This control is appropriate for implementing a zooming bar in your applications.", GetXmlFileByName("zoomTrackBar.xml"), GetFileNameByName("ModuleZoomTrackBar.cs"));
AddModuleInfo(35, 25, "DXValidationProvider", GetImageFromResources("validationprovider.gif"), typeof(ModuleDXValidationProvider), "This tutorial demonstrates how to perform data validation via the DXValidationProvider component. This component allows you to associate specific validation rules with editors, and perform validation manually or automatically (on leaving editors). In the example, validation rules are created and applied to editors in code. However, these can also be created at design time via the component's designer. Practice changing the editors' values to violate validation rules and see how the editors respond.", GetXmlFileByName("dxvalidationprovider.xml"), GetFileNameByName("DXValidationProvider.cs"));
AddModuleInfo(39, 1, "SparklineEdit (new)", GetImageFromResources("sparkline_edit.gif"), typeof(ModuleSparklineEdit), "This tutorial demonstrates a SparklineEdit control. This control visualizes data in a highly condensed way thus allowing end-users to quickly understand and compare values from different sources.", GetXmlFileByName("SparklineEdit.xml"), GetFileNameByName("ModuleSparklineEdit.cs"));
AddModuleInfo(40, 1, "ToggleSwitch (new)", GetImageFromResources("toggle_switch.gif"), typeof(ModuleToggleSwitch),
"This tutorial demonstrates a ToggleSwitch editor that has on and off states.", GetXmlFileByName("toggleSwitch.xml"), GetFileNameByName("ModuleToggleSwitch.cs"));
}
protected override DevExpress.DXperience.Demos.LookAndFeelMenu CreateMenu(DevExpress.XtraBars.BarManager manager, DevExpress.LookAndFeel.DefaultLookAndFeel lookAndFeel) {
return new EditorsTutorialMenu(manager, lookAndFeel, "Tutorial examples for the " + AssemblyInfo.SRAssemblyEditors);
}
}
}