How to Convert a view into a Pane or Panel in Red - red

So I have a view that is currently working and looking like I want. What I would like to do take the content it contains wrap it inside a variable and put it inside of a tab-panel. To do this, I believe I need to convert it to a panel or some such. But I am not really sure how.
Here is the view,
Red [ Title: "Editor" needs: 'view]
s: 110x25
ts: 50x50
view [size 800x800 title "Red Edit"
drop-down s "Debug" data ["Debug" "Release"]
drop-down s "Windows" data ["Windows" "MacOSX" "Linux" "BSD" ]
button s "Compile" [] across
button s "Run" []
return
a: area 700x700 black
]
Here is the tab-panel
view [backdrop brown
title "Red Edit"
tab-panel 820x820 [
"File1" []
]
]
It would go inside of the first tab named "File1".
My attempts thus far have given me a compiler error telling me that the panel I am trying to create has no value.
Also, tips on syntax and coding style would be appreciated too since I am still learning red.
Update: here is how I would like to combine them :
Red [ Title: "Editor" needs: 'view]
s: 110x25
ts: 50x50
p: [size 800x800 title "Red Edit"
drop-down s "Debug" data ["Debug" "Release"]
drop-down s "Windows" data ["Windows" "MacOSX" "Linux" "BSD" ]
button s "Compile" [] across
button s "Run" []
return
a: area 700x700 black
]
view [backdrop brown
title "Red Edit"
tab-panel 820x820 [
"File1" [text "hello" p]
]
]
If I do this, p never gets displayed.

If I was going to make a guess about your intentions, I think your real question is:
How can I compose and glue GUI stuff together?
There are several ways to do this, but the first thing you should ask is:
Do I need to?
As #dockimbel says if it isn't dynamic, you can simply have it after tab-panel word inside the dialect block [], and this is idiomatic:
tab-panel [<rest of gui here>]
Method 1: Compose into the dialect with a block
This is the next simplest way, using your code:
Red [ Title: "Editor" needs: 'view]
s: 80x25
ts: 50x50
cnt-object: layout cnt-view-dialect-blk: [
;size 80x80 title "Red Edit"
drop-down s "Debug" data ["Debug" "Release"]
drop-down s "Windows" data ["Windows" "MacOSX" "Linux" "BSD" ]
button s "Compile" []
;across
button s "Run" []
return
a: area 350x150 black
]
; view cnt-object
pnl-object: layout pnl-view-dialect-blk: compose/deep [
title "Red Edit"
tab-panel 400x200 [
"File1" [(cnt-view-dialect-blk)]
]
]
view pnl-object
Method 2: Use the view face! object
This requires a steeper learning curve, but makes everything much easier when you learn it, and is probably more efficient too! If you read the documentation for face!:
button: make face! [type: 'button]
Then look back at what I've named as -object in the code above, you realize they are conceptually the same thing. That is, an object! created with make.
If you're doing this way, one of the most useful things is /pane and /parent to move up and down the hierarchy
Further considerations
View is not a "thing" as it appears on the surface. It may refer to the VID dialect (what you have in [blocks]), or view function which is used to display things in the view engine. The actual things are face! objects, created manually with make or by the layout function.
I've labelled -view-dialect-blk, written in the actual view dialect, which is conceptually different from the actual objects. If you inspect all that I've labelled with ??, I think you'd be a few steps closer to understanding how everything works under the hood ;-)
It's also good to read up on rebol2 view concepts and the official documentation until red's catches up with it. Though slightly different, the concepts are the same

Related

Creating an animation in the render tab

I am new to Houdini but I was able to make a nice scientific visualization in the "Render View " window. I would like to have my model spin/rotate. I found a way to do that in "Scene View" but is there a way to do his in "Render View"
I guess you already using geometry operators.
Within geo, you may add "transform node" at the end of your nodes, then use something like "$F * 10" in ry option.

How to focus a custom view when writing a VS Code extension?

I need help with my VS Code extension. I've written a custom view which works just fine, however I'd like to activate / focus / bring into view that view by using a keyboard shortcut or a context menu command. I am unable to find how to use the VS code API to achieve that.
context.subscriptions.push(vscode.commands.registerCommand('extensionId.showView', () =>
{
// how to do that?
}));
I know this can be done, because one can display the file explorer by using this code snppet:
vscode.commands.executeCommand('workbench.view.search');
But how would you do that for a custom tree view?
You should be able to use the new focus option that was added to TreeView.reveal() in 1.25 for that. The method requires you to pass a tree item to be revealed, so it's more of a workaround for not being able to focus the view itself directly, but you could simply pass the first / root node.
treeView.reveal(item, {focus: true});
Note that focus in this case means keyboard focus. If you just want to bring it into view, calling reveal() without the focus option is good enough.
To obtain a TreeView instance, you need to call vscode.window.createTreeView() with your view ID and provider.
I think, it is also possible to use
vscode.commands.executeCommand("exampleView.focus")
using the exampleView declared in package.json:
...
"views": {
"exampleView": [
{
"id": "exampleView",
"name": "Example View"
}
]
},
...
as #Empiire said, focus command in the form of : vscode.commands.executeCommand
and adding the '.focus' at the end of the id of the view that was declared in the package.json works!
You can also provide an object as parameter such as { preserveFocus: true } to show without disturbing the current focus.
eamodio does it like that in gitlens : https://github.com/gitkraken/vscode-gitlens/blob/417587d0dfcda89e9e2d723f8b662d7cf9008c8f/src/webviews/webviewViewBase.ts#L85

In Filemaker, after searching *within* search results, how can I return to my previous search results?

I'm creating an inventory database in Filemaker Pro Advanced (v15) for my little café, and I've made a little red button that appears in the header if any of our items drop down below a certain level, so when I click that button, it shows just those items that need reordering.
It performs that action by running a script like so:
Go to Layout [ “Inventory Reorders Required” (Inventory) ]
Enter Find Mode [ Pause: Off ]
Set Field [ Inventory::Availability ; "Reorder Required" ]
Perform Find []
Sort Records [ Restore ; With dialog: Off ]
It then goes to a duplicated layout whose only difference (aside from color change) is, the button changes to a "show all" function, which is how I want it to act from the main page.
Enter Browse Mode [ Pause: Off ]
Go to Layout [ “Inventory” (Inventory) ]
Show All Records
Sort Records [ Restore ; With dialog: Off ]
If I do a search—for instance, for "coffee beans,"—clicking that little red button from the search results will narrow the search to just the coffee beans that need reordering—NOT all products that need reordering—again, just how I want it to act.
My question is: Like how I have the button set to return to showing all items when clicked from the main page, I'd like it to return to showing all search results when clicked from the search results page. But I can't find any way to do that. My "solution" so far has been to just disable that button from appearing on the search results layout, but it'd sure be a handy feature to have if we can make it work.
Any chance you could open the reorder layout in a new window, preserving your old found set in the background and operating on the new found set in the foreground? Then when the user is done with the reorder window, they can close it (or the button can close the window) and the user will be left with the original found set.
The simplest way could be to just open a new window when you click the red button and show your filtered output. Then, just close the window to return to the window with your previous results. In FileMaker 16, you could have used a card window for this also.
Otherwise, http://www.soliantconsulting.com/blog/2016/03/recreating-a-filemaker-found-set describes several methods of restoring found sets.

Nintex Forms 2010 - How to set a rule with multiple checkbox options

I have a Nintex form and one field has 5 checkboxes where the user can make multiple selections:
Please select all that apply: [] red [] blue [] green [] yellow [] purple
If the user makes any selection that contains "purple" then i want another field to show asking for additional information.
I currently have my question field in a panel and this is the current rule for that panel:
not(Colors == "purple")
Right now it works but only when "purple" is the only selection. I need a statement that says -- Only show if Colors[the checkbox field] equals any combination of choices containing purple.
What's the correct syntax to use?
!inArray(Colors,"Purple")
SharePoint puts multiple selection in an array. Just add this rule to each control and change "Purple" to your other choices.
Here is an example of a rule, if you want one control be selected if one of the two colors are selected.
!inArray(Colors,"Purple") || inArray(Colors,"Red")

Crystal Reports Legends

Is there a way to force a Bar Chart legend in Crystal Report 11.5 to display its objects in a particular order?
For Example, say I am reporting on the consumption of "Bananas" and "Apples" by State. The Bar Chart should display the percentage of people who eat these fruits by county (Percent Bar Chart). The "Apples" percentage always displays on top of the bar chart and the "Bananas" on the bottom. The legend for this graph also displays the "Apple" color first, then the "Banana" color. However, if the "Banana" percentage is 0% the legend displays the "Banana" color first on the legend. This creates a inconsistent report (with plenty of complaints).
I would like the "Banana" color to always display second in the legend. Hope I didn't confuse anyone and any ideas would be helpful.
Try this instead:
1. Right-click to go into the Chart Expert. Go into the Data tab.
2. If it isn't already set to it, set the grouping method thingy on the top right to On Change of
3. Click Order, then Specified Order
4. There are 2 new tabs: Specified Order and Others. Use the first to decide which groups go first and the second to decide what to do with the rest.
Since you're specifying the order of your groups in the chart, Crystal won't try to auto-decide which ones go first. Step 2 may be an issue for your chart depending on how you set it up. In that case, I suggest making a new chart from scratch.
I can't call myself an expert. I hope this helps.
I think I was able to replicate your issue. It is a little strange, but I was able to bypass the issue by changing the chart to one of the other 2 bar chart types ("Stacked Bar Chart" or a "Side-By-Side Bar Chart"). I'd recommend using one of those, or perhaps even a pie chart.