how to remove or hide tree node in dev express navbar control containing treelist, using code - devexpress-windows-ui

how to remove or hide tree node in dev ex press navbar control
containing treelist, using codeemphasized text
foreach (ToolStripMenuItem mi in mastersToolStripMenuItem.DropDownItems)
{
if (mi.Text == "Batch")
{
mastersToolStripMenuItem.DropDownItems.Remove(mi);
}
}
and
foreach (ToolStripMenuItem mi in mastersToolStripMenuItem.DropDownItems)
{
if (mi.Text == "Batch")
{
mi.visible=fase;
}
}
both not working

some how got the answer
treeListMaster.Nodes[4].Nodes.RemoveAt(7);
treeListMaster.Refresh();

Related

Jetpack compose LazyColumn or Scrollable Column and IME padding for TextField doesn't work

I am trying to set a list if text fields, and when user set the focus on one text field at the bottom I expect that the user can see the appearing IME soft keyboard and the text field being padded according to the configuration set in my manifest file android:windowSoftInputMode="adjustPan", but it doesn't work the first time, it works only when some of the listed textfield have already a focus.
Behavior in video.
My code in onCreate method.
// Turn off the decor fitting system windows, which allows us to handle insets,
// including IME animations
WindowCompat.setDecorFitsSystemWindows(window, false)
setContent {
// Provide WindowInsets to our content. We don't want to consume them, so that
// they keep being pass down the view hierarchy (since we're using fragments).
ProvideWindowInsets(consumeWindowInsets = false) {
MyApplicationTheme {
// A surface container using the 'background' color from the theme
Surface(color = MaterialTheme.colors.background, modifier = Modifier.systemBarsPadding()) {
Column(modifier = Modifier.fillMaxHeight()) {
val list: List<#Composable () -> Unit> = (1..10).map {
{
Text(text = "$it")
Divider()
TextField(value = "", onValueChange = {}, modifier = Modifier.navigationBarsWithImePadding(),)
}
}
LazyColumn(modifier = Modifier.fillMaxSize().weight(1F)) {
itemsIndexed(list) { index, inputText ->
inputText()
}
}
}
}
}
}
}
If your problem is going on, check Insets for Jetpack Compose.
Only add this dependency:
implementation 'com.google.accompanist:accompanist-insets:{insetsVersion}'
and use Modifier.imePadding() or the custom solution:
#Composable
fun ImeAvoidingBox() {
val insets = LocalWindowInsets.current
val imeBottom = with(LocalDensity.current) { insets.ime.bottom.toDp() }
Box(Modifier.padding(bottom = imeBottom))
}

NavigationLink not working if label is conditional

I have created a scroll bar with a list of folders created by the user like in the picture
a simple navigation link navigates inside the folder.
in order to give the option to the user to delete the folder, on the navigation view label I put an IF that change the icon of the folder base if the editing mode is on or off.
my issue is, when I'm changing the icon setting the var isEditFolderModeON = true with a long press gesture.
all working fine, problem is since I put the long press gesture in the Navigation link label it stop to work.
any solution?
where I can move the long pressure gesture,
thanks
NavigationLink(destination: FolderViewAirport(fm: self.fm, dm: self.dm, folders: folder)
.onAppear(perform: {
self.fm.updateFolderData(dm: self.dm) {
}
})
) {
if self.isEditFolderModeON {
FolderBarEdit( folder: folder)
.onTapGesture {
self.fm.delateFolderTouch(nameFolder: folder)
}
}
else if self.isEditFolderModeON == false {
FolderBar(folder: folder)
.onLongPressGesture {
self.isEditFolderModeON = true
}
}
}
if I remove the .onLongPressGesture {} it works, but where I can put the self.isEditFolderModeON = true

How can I modify the statusbar only when the active tab is of a certain file type

I have created an extension for VSC that adds some statusbar buttons when a file of type JS/TS is opened. But I would rather only show the buttons if the active tab is JS/TS. Currently if I open a markdown file and a JS file the status bar buttons are added even when the MD file is the active tab.
Is there some kind of event that gets called when users swap tabs that I could use to show/hide my buttons.
Here is my repo:
https://github.com/sketchbuch/vsc_quokka_statusbar
Changing active text editor event
vscode.window.onDidChangeActiveTextEditor(editor => {
if (!editor) {
// hide
return;
}
if (editor.document.languageId === 'javascript' || editor.document.languageId === 'typescript') {
// show
} else {
// hide
}
});
If you want to consider all visible editors (split/grid):
vscode.window.onDidChangeVisibleTextEditors(editors => {
if (editors.some(editor => {
return editor.document.languageId === 'javascript' || editor.document.languageId === 'typescript';
})) {
// show
} else {
// hide
}
});

How to Keep Tabs on a Particular Tab?

In my firefox sdk addon, I want to use a custom webpage from my data directory as my settings/about page.
But I am having trouble keeping tabs on the tab!
So I have a button that calls the OptionsPanel() function to open my webpage in a new tab. Now, I want to make it so if the user forgets that tab is open and pushes the button again, that it activates the already-open settings tab. That means I need to know that the tab is open and I need to be able to switch to it if it is OR open it if it is not already open.
Here is what I've come up with so far, but it doesn't work; it just always opens a new tab. I don't even know if I'm barking up the right tree.
const tabs = require("sdk/tabs");
var optionsTab;
function OptionsPanel(){
var opsTab = GetTabByID(optionsTab.id);
if(opsTab == null){
tabs.open( data.url("OptionsPanel.html") );
optionsTab.id = tabs.tab.id; <======errors out as undefined
}else{
opsTab.activate();
}
}
//return a handle to the tab that matches specified tab id
function GetTabByID(whatid){
for(let thistab of tabs){
if(thistab.id = whatid){
return thistab;
}
}
return null;
}
So, here are my goals:
Open my page in a new tab if it isn't already open.
If the tab is already open, then switch to that tab.
If the page is open when the browser loads, then be ready to switch to that tab if the user pushes the options button.
Why would you think tabs module has a tab property?
Normally you would use the activeTab property instead. However it does not get updated immediately after tabs.open is called. One has to use tabs[tabs.length - 1] instead.
const tabs = require("sdk/tabs");
var optionsTabId;
function OptionsPanel(){
var opsTab = GetTabByID(optionsTabId);
if (opsTab == null) {
tabs.open( data.url("OptionsPanel.html") );
optionsTabId = tabs[tabs.length - 1].id;
} else {
opsTab.activate();
}
}
Additionally, you made a mistake in GetTabByID.
//return a handle to the tab that matches specified tab id
function GetTabByID(whatid){
for(let thistab of tabs){
if(thistab.id == whatid){ // use == to compare
return thistab;
}
}
return null;
}
Keep in mind this assumes that it is not possible to navigate away from your options tab. I would check optsTab.url just in case.
Alternatively you could make use of the tab event interface
const tabs = require("sdk/tabs");
const OPTIONS_URL = data.url("OptionsPanel.html");
var optionsTab = null;
function OptionsPanel(){
if (optionsTab == null) {
tabs.open(OPTIONS_URL);
tabs.once('ready', function(tab) {
optionsTab = tab;
optionsTab.on('ready', function readyListener(tab) {
if (tab.url !== OPTIONS_URL) {
optionsTab.off('ready', readyListener);
optionsTab = null;
}
})
optionsTab.once('close', function(tab) {
optionsTab = null;
})
});
} else {
optionsTab.activate();
}
}

How do I inspect and interact with trails in KRL?

I have a trail that I'm using to track app history in KRL. I'm looking for an easy way to debug the trail, including seeing what is currently on the trail and clearing it.
Is there an easy way to do that in KRL?
The easiest way, for me, to see what is on the trail is to output it's contents to the browser console.
rule inspect_data_on_trail {
select when pageview ".*"
pre {
visitedDomains = ent:visitedDomains;
}
{
emit <|
console.log(visitedDomains);
|>;
}
}
firebug output after running ruleset several times:
To clear entity variables including trails, I usually just write a rule that selects on a domain that isn't part of my app's experience and clear the varaibles when the app is run on that domain.
rule clear_everything {
select when pageview "yahoo\.com"
{
notify("Cleared",":)") with sticky = true;
}
fired {
clear ent:visitedDomains;
}
}
Full example app:
ruleset a60x458 {
meta {
name "trail-debugging"
description <<
trail-debugging
>>
author "Mike Grace"
logging on
}
rule put_data_onto_trail {
select when pageview ".*"
pre {
domain = page:url("domain");
}
{
notify("Thanks for visiting #{domain}","You visit has been recorded") with sticky = true;
}
fired {
mark ent:visitedDomains with domain;
}
}
rule inspect_data_on_trail {
select when pageview ".*"
pre {
visitedDomains = ent:visitedDomains;
}
{
emit <|
console.log(visitedDomains);
|>;
}
}
rule clear_everything {
select when pageview "yahoo\.com"
{
notify("Cleared",":)") with sticky = true;
}
fired {
clear ent:visitedDomains;
}
}
}