本教程介绍如何使用ui.qml文件开发一个应用程序,使应用程序逻辑从UI中分离。该教程使用Qt Quick Designer实现一个简化版的UI表单示例,它为一个客户数据库提供接口,只用QML和JavaScript编写。
jQuery EasyUI致力于帮助web开发者更轻松的打造出功能丰富并且美观的UI界面。jQuery EasyUI提供了基于当下流行的jQuery core和HTML5的控件,助您打造适合当今网络的应用程序。
using System.Windows.Forms; using Leadtools; using Leadtools.Codecs; using Leadtools.WinForms; using Leadtools.Annotations;
RasterImageViewer viewer = new RasterImageViewer();
RasterImage img;
AnnAutomationManager annger;
AnnAutomation automation;private void initControl() {
Support.SetLicense();
viewer.Dock = DockStyle.Fill;
panel1.Controls.Add(viewer);
viewer.HorizontalAlignMode = RasterPaintAlignMode.Center;
viewer.VerticalAlignMode = RasterPaintAlignMode.Center;
loadImage("qwe.jpg");
if (viewer.Image != null)
{
// create and setup the automation manager
annger = new AnnAutomationManager();
// Instruct the manager to create the default (all) automation objects.
annger.CreateDefaultObjects();
// create the toolbar and add it to the form
annger.CreateToolBar();
Controls.Add(annger.ToolBar);
// setup the automation (will create the container as well)
automation = new AnnAutomation(annger, viewer);
// add an event handler for changes to the current designer
automation.CurrentDesignerChanged += new EventHandler(automation_CurrentDesignerChanged);
// setup this automation as the active one
automation.Active = true;
}
toolStripComboBox1.SelectedIndex = 0;
}
private void loadImage(string filename)
{
img = new RasterCodecs().Load(filename);
viewer.Image = img;
}
private void automation_CurrentDesignerChanged(object sender, EventArgs e)
{
AnnAutomation automation = sender as AnnAutomation;
AnnButtonRunDesigner buttonRunDesigner = automation.CurrentDesigner as AnnButtonRunDesigner;
if (buttonRunDesigner != null)
buttonRunDesigner.Run += new EventHandler(buttonRunDesigner_Run);
}private void buttonRunDesigner_Run(object sender, AnnRunDesignerEventArgs e)
{
if (e.OperationStatus == AnnDesignerOperationStatus.End)
{
AnnButtonObject btn = e.Object as AnnButtonObject;
MessageBox.Show(string.Format("Button with text = {0} was clicked!", btn.Text));
}
}
private void loadImage(string filename)
{
img = new RasterCodecs().Load(filename);
viewer.Image = img;
}
private void toolStripComboBox1_SelectedIndexChanged(object sender, EventArgs e)
{
annger.UserMode = (toolStripComboBox1.SelectedIndex == 0) ? AnnUserMode.Design : AnnUserMode.Run;
}
JS框架,我认为大体上可以分为两种。一种是类似jQuery/ d3那样的,通过修改html的DOM结构来渲染UI的库。
还有一种则是类似于AngularJS/ReactJS 那样的,采用MVC分层的,通过Model来渲染View UI框架。
注意这里的区别,jQuery类似于库,而Angular类似于框架,这也意味着使用Angular要严格按照框架规定来写。但Vue虽然也是MVC渲染,但更像一个库,所以明显要比Angular上手要容易。
