|
@@ -140,6 +140,38 @@ To manipulate the layout:\n\
|
|
|
|
|
|
EXAMPLE_COMMON_END
|
|
EXAMPLE_COMMON_END
|
|
}
|
|
}
|
|
|
|
+void ui_Operator(laUiList *uil, laPropPack *This, laPropPack *DetachedProps, laColumn *UNUSED, int context){
|
|
|
|
+ EXAMPLE_COMMON_BEGIN
|
|
|
|
+
|
|
|
|
+ laColumn* c=laFirstColumn(uil);
|
|
|
|
+
|
|
|
|
+ laShowLabel(uil,c,"\n\
|
|
|
|
+Operator demonstration program\n\
|
|
|
|
+------------------------------\n\
|
|
|
|
+ Press the \"Something!\" Button to invoke a one-time operator, you can see some strings printed on stdout and LaGUI Terminal.\n\
|
|
|
|
+ Use 🞆->Terminal to show LaGUI Terminal.",0,0)->Flags|=LA_TEXT_LINE_WRAP|LA_TEXT_MONO;
|
|
|
|
+
|
|
|
|
+ EXAMPLE_COMMON_END
|
|
|
|
+}
|
|
|
|
+void ui_SimpleProperties(laUiList *uil, laPropPack *This, laPropPack *DetachedProps, laColumn *UNUSED, int context){
|
|
|
|
+ EXAMPLE_COMMON_BEGIN
|
|
|
|
+
|
|
|
|
+ laColumn* c=laFirstColumn(uil);
|
|
|
|
+
|
|
|
|
+ laShowLabel(uil,c,"\n\
|
|
|
|
+Properties demonstration program\n\
|
|
|
|
+--------------------------------\n\
|
|
|
|
+ The simplest program to demonstrate how to register properties for them to show on the interface.\n\n\
|
|
|
|
+Play with this demo:\n\
|
|
|
|
+--------------------\n\
|
|
|
|
+ 1) You can manipulate the value widgets.\n\
|
|
|
|
+ 2) You can right click them for extra opeartions.\n\
|
|
|
|
+ 3) Create a new \"Properties\" panel from the 🞆 button, \
|
|
|
|
+verify that adjustiing values in either panels would cause the other panel to refresh in sync.\n\
|
|
|
|
+ ",0,0)->Flags|=LA_TEXT_LINE_WRAP|LA_TEXT_MONO;
|
|
|
|
+
|
|
|
|
+ EXAMPLE_COMMON_END
|
|
|
|
+}
|
|
void ui_Widgets(laUiList *uil, laPropPack *This, laPropPack *DetachedProps, laColumn *UNUSED, int context){
|
|
void ui_Widgets(laUiList *uil, laPropPack *This, laPropPack *DetachedProps, laColumn *UNUSED, int context){
|
|
EXAMPLE_COMMON_BEGIN
|
|
EXAMPLE_COMMON_BEGIN
|
|
|
|
|
|
@@ -231,7 +263,7 @@ int inv_OpenDemoSource(laOperator* a, laEvent* e){
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
-laPropContainer *pcGeneric,*pcFruits,*pcSimplest,*pcModelling,*pcCalculator,*pcWidgets,*pcWidgetFlags;
|
|
|
|
|
|
+laPropContainer *pcGeneric,*pcFruits,*pcSimplest,*pcOperator,*pcSimpleProperties,*pcModelling,*pcCalculator,*pcWidgets,*pcWidgetFlags;
|
|
|
|
|
|
void* get_ExampleViewer(void* unused){
|
|
void* get_ExampleViewer(void* unused){
|
|
return EV;
|
|
return EV;
|
|
@@ -239,6 +271,8 @@ void* get_ExampleViewer(void* unused){
|
|
laPropContainer* get_ExamplesGetType(ExampleItem* ei){
|
|
laPropContainer* get_ExamplesGetType(ExampleItem* ei){
|
|
if(ei->Define==ui_Fruits) return pcFruits;
|
|
if(ei->Define==ui_Fruits) return pcFruits;
|
|
if(ei->Define==ui_Simplest) return pcSimplest;
|
|
if(ei->Define==ui_Simplest) return pcSimplest;
|
|
|
|
+ if(ei->Define==ui_Operator) return pcOperator;
|
|
|
|
+ if(ei->Define==ui_SimpleProperties) return pcSimpleProperties;
|
|
if(ei->Define==ui_Modelling) return pcModelling;
|
|
if(ei->Define==ui_Modelling) return pcModelling;
|
|
if(ei->Define==ui_Calculator) return pcCalculator;
|
|
if(ei->Define==ui_Calculator) return pcCalculator;
|
|
if(ei->Define==ui_Widgets) return pcWidgets;
|
|
if(ei->Define==ui_Widgets) return pcWidgets;
|
|
@@ -273,6 +307,8 @@ static void InitExamples(){
|
|
laAddStringProperty(pc,"code","Code","Code of the example",LA_WIDGET_STRING_MULTI,0,0,0,1,offsetof(ExampleItem,Code),0,0,0,0,LA_READ_ONLY);
|
|
laAddStringProperty(pc,"code","Code","Code of the example",LA_WIDGET_STRING_MULTI,0,0,0,1,offsetof(ExampleItem,Code),0,0,0,0,LA_READ_ONLY);
|
|
|
|
|
|
EXAMPLE_ADD_PC("simplest",pcSimplest,ui_Simplest);
|
|
EXAMPLE_ADD_PC("simplest",pcSimplest,ui_Simplest);
|
|
|
|
+ EXAMPLE_ADD_PC("operator",pcOperator,ui_Operator);
|
|
|
|
+ EXAMPLE_ADD_PC("simple_properties",pcSimpleProperties,ui_SimpleProperties);
|
|
EXAMPLE_ADD_PC("fruits",pcFruits,ui_Fruits);
|
|
EXAMPLE_ADD_PC("fruits",pcFruits,ui_Fruits);
|
|
EXAMPLE_ADD_PC("widgets",pcWidgets,ui_Widgets);
|
|
EXAMPLE_ADD_PC("widgets",pcWidgets,ui_Widgets);
|
|
EXAMPLE_ADD_PC("widget_flags",pcWidgetFlags,ui_WidgetFlags);
|
|
EXAMPLE_ADD_PC("widget_flags",pcWidgetFlags,ui_WidgetFlags);
|
|
@@ -281,6 +317,8 @@ static void InitExamples(){
|
|
|
|
|
|
EV=memAcquire(sizeof(ExampleViewer));
|
|
EV=memAcquire(sizeof(ExampleViewer));
|
|
AddExample("Simplest","simplest",ui_Simplest);
|
|
AddExample("Simplest","simplest",ui_Simplest);
|
|
|
|
+ AddExample("Operator","operator",ui_Operator);
|
|
|
|
+ AddExample("Simple Properties","simple_properties",ui_SimpleProperties);
|
|
AddExample("Widgets","widgets",ui_Widgets);
|
|
AddExample("Widgets","widgets",ui_Widgets);
|
|
AddExample("Widget Flags","widget_flags",ui_WidgetFlags);
|
|
AddExample("Widget Flags","widget_flags",ui_WidgetFlags);
|
|
AddExample("Fruits","fruits",ui_Fruits);
|
|
AddExample("Fruits","fruits",ui_Fruits);
|