dynamically choice icons on tmux.conf - tmux

I want to dynamically show circle or triangle in my tmux bar.
For that, I call i_right in my status-right.
i_right is implemented here :
# --> icons
i_circle_right=''
i_triangle_right=''
i_circle_left=''
i_triangle_left=''
set_triangle='1'
i_right='#{?$set_triangle==1,'$i_triangle_right','$i_circle_right'}'
i_left='#{?$set_triangle==1,'$i_triangle_left','$i_circle_left'}'
The idea is to handle the choice of the form via set_triangle but when I pass set_triangle to 0 nothing change.
What I miss ?
I use this documentation : https://www.man7.org/linux/man-pages/man1/tmux.1.html

Related

how to write conditional css in angular4?

I have a table which each row is looping based on api data. In one column I have an edit icon and on click of the icon one pop will open. I just want to show the popup once at a time, means if one popup is open user won’t able to click the remaining edit icon. I just tried to use the css - "pointer-events: none” to disable the icon but how to write the condition?
First, you will need to have access to the popup (generic utility) which can tell you that if the popup is open or closed. You can maintain it by a variable or method - depending on how you have built/using the popup functionality in your application.
If you are using any of the Angular specific built-in libraries for popup then it might have this utility.
Once you get the popup open state then there are multiple ways in Angular template which you can use to set pointer-events none to disabled icon:
NgClass - <a class="icon" [ngClass]="{'pointer-none': popup_isOpen}"></a>
Also in your css define class -
.pointer-none {
pointer-events : none;
}
NgStyle - <a class='icon' [ngStyle]="{'pointer-events': popup_isOpen ? 'none' : 'inherit'}"></a>

How to add global barButtonItems to custom UINavigationBar?

I am currently trying to create a custom UINavigationBar Subclass.
What i want to achieve is that all custom navigationbars inside my app should have a couple of barbuttonitems in common. But it should still be possible to define left or .rightbarItems on the navigationItem in code.
What i tried so far is that subclassed the UINavigationBar and played around with all methods and delegate callbacks i could potentially use to change the navigationItem. There are methods like
setItems:animated:
setItems:
navigationBar:didPushitem etc.
.. which could be used to modify the navigationItem somehow.
But there is no callback which can be used to change the item initially.
What i basically want to know is how it is possible to change navigationItem initially before it is being pushed ?
Solved it by myself using
willShowViewController of the UINavigationControllerDelegateProtocol
to modify the navigationItem

windows form make a form starts at a specific position

I made a simple program with two forms. the first form is small, the second one is large.
I already handled the screen resolution thing so the scroll is working and I tested the application on many screen sizes and resolutions.
my problem is this:
when I go from the first form to the second form, the second form doesn't start from the top left of the screen so the result is this:
I have to drag it to the top to see the two buttons at the bottom like this:
my question is: is there a way to make this form starts as in the second image, not the first one?
There is a proprety called StartPosition with it you can define the startup position of a form
PS : if you want a costum position for exemple if you wan it to be in the coordinate : X=15 and Y =20
in the FormLoad Event (double click the form ;) ) put this :
Form1.Location = new Point(15, 20);
OR THIS :
Form1.Top=20;
Form1.Left=15;
Forms.StartPosition is the property to work with.
Usually setting it to CenterParent or CenterScreen should work well for your requirement.
Instead if you want to fine tune the position of the form then you should set the property to Manual and then work with the Location property (a Point structure) calculating the correct location desidered.
Also, keep in mind that if you want to manually work with Location and Size of the form you should do it overriding the OnLoad event, as explained in this question

Next and previous control button in winAPI to go to next page (c++)

I am creating an winAPI application in c++ I have a photo in preview pane and I want to create two buttons NEXT and PREVIOUS on clicking them I will go to the next page .
Could you please give me the idea how to do that in c++ ??
Do I need to use QT libraray or it can be done using the in built function of WinAPI like -
HWND hwndButton1 = CreateWindow(L"BUTTON",L"NEXT",WS_TABSTOP | WS_VISIBLE | WS_CHILD | BS_DEFPUSHBUTTON,550,800,100,30,m_hwndPreview,(HMENU)buttonid1,(HINSTANCE)GetWindowLong(m_hwndPreview, -6),NULL);
HWND hwndButton2 = CreateWindow(L"BUTTON",L"PREVIOUS",WS_TABSTOP | WS_VISIBLE | WS_CHILD | BS_DEFPUSHBUTTON,650,800,100,30,m_hwndPreview,(HMENU)buttonid2,(HINSTANCE)GetWindowLong(m_hwndPreview, -6),NULL);
and then using WM_COMMAND for both the button clicks.
Am I going right?
I just want my API application work like a .pdf extension file...as in PDF files we have up and down arrow and on clicking upon them we can go to the next page..In winAPIc++ I couldn't find any such arrow function.. please tell me if there is any such arrow up/down function present to go to next page (because I am very less interested in creating NEXT and PREVIOUS button using createwindow function.. It looks odd).
You have not mentioned what tools you are using, so we don't know if you have a resouce editor. You should research that in a forum appropriate for the tools. If you think writing one line of code to create a button is "very complicated" then you need a better tool.
If you do not want the buttons to appear on top of the picture then you need another place to put them. One common possibility is a toolbar. It is a strip for buttons along the top or bottom of the main window:
http://msdn.microsoft.com/en-us/library/windows/desktop/bb760435(v=vs.85).aspx
With a resource editor you can draw an arrow on the button. Without a resource editor you can set the button text to a unicode arrow:
SetWindowText(hwndButton1, L"\x25bc"); // down arrow, use 25b2 for up arrow
Most buttons (and other controls) are created using a resource editor, placing the controls on a dialog template or a toolbar resource. If you do that Windows will create the buttons when you create the dialog or toolbar. This method is much preferred because Windows will adjust the size of the buttons as required for the screen settings in use.
If you can't do that you must use CreateWindow as you are doing.
Finally it is done.. I have created the buttons neither using Qt or nor using any createWindowEx..The best and easy approach to follow is resource editor ...just put some button on dialog and use IDD_MAINDIALOG (in my case)
m_hwndPreview = CreateDialogParam( g_hInst,MAKEINTRESOURCE(IDD_MAINDIALOG), m_hwndParent,(DLGPROC)DialogProc, (LPARAM)this);
and then
BOOL CALLBACK AMEPreviewHandler::DialogProc(HWND m_hwndPreview, UINT Umsg, WPARAM wParam, LPARAM lParam)
{
switch(Umsg) // handle these messages
{ .........
}
....
}
and thats done. Very easy task.

QRadioButton check/uncheck issue in Qt

I am finding issues related to check/uncheck of QRadioButton. The images I have used for checking(a white dot) and unchecking(without a white dot) is not updated.
My issue is like: I have implemented few QRadioButton(s). For the first time all the QRadioButtons checked false. So the images for this case is without a white dot. When user selects any QRadioButton then it's image changes to another i.e. image with a white dot. On a button click I am resetting the state of the radio buttons from checked to uncheck state . However the images state are not changing. They remain in checked state. The code snippet is as follows:
Code:
if(ui->radioButtonReadOnlineData->isChecked())
ui->radioButtonReadOnlineData->setChecked(false);
if(ui->radioButtonSavetoDBReadOfflineData->isChecked())
ui->radioButtonSavetoDBReadOfflineData->setChecked(false);
if(ui->radioButtonViewLocalData->isChecked())
ui->radioButtonViewLocalData->setChecked(false);
if(ui->radioButtonDateRange->isChecked())
ui->radioButtonDateRange->setChecked(false);
if(ui->radioButtonAll->isChecked())
ui->radioButtonAll->setChecked(false);
The images for each of the QRadioButtons is set as like:
Code:
ui->radioButtonAll->setStyleSheet(
"QRadioButton::indicator::checked { image: url(:/Resources/radio-btn-selected.png);}"
"QRadioButton::indicator::unchecked {image: url(:/Resources/radio-btn-unselected.png);}"
);
Any clues why the QRradioButton images are not updated. Thanks.
Your problem is most probably related to
setAutoExclusive(bool)
By default all buttons belonging to the same parent behave as if they were part of the same exclusive button group. After having selected one you are not able to return to having all buttons unchecked.
A work around is to find out what button is checked, and for that button do the following
theSelectedButton->setAutoExclusive(false);
thsSelectedButton->setChecked(false);
theSelectedButton->setAutoExclusive(true);
Take a look at these links for more information:
http://developer.qt.nokia.com/forums/viewthread/5482
http://www.qtforum.org/article/19619/qradiobutton-setchecked-bug.html
Make sure your resource file look like :
<qresource>
<file>Resources/radio-btn-selected.png</file>
<file>Resources/radio-btn-unselected.png</file>
</qresource>
And that it is included correctly in your application.
Either include the .qrc in your .pro file with
RESOURCES = myresource.qrc
either create an external binary resource file, then register it at runtime with
QResource::registerResource("/path/to/myresource.rcc");
Or if you are using the designer, you can do like this.

Resources