Submitted by MaciejWasyluk on 2017/11/23 14:04
 Is it possible to, with use of conditional formating, to automatically strikethrough/color items marked as done? For example, if item is done then set his color to grey and/or strike it through.
 
Thank you for help,
Maciej

Comments

hi Maciej
 
(This hotkey may have changed, but I dont think so) by default Ctrl+M marks an item as done, adds the date to the done field and (maybe) colors the item.
The colouring may not happen by default, if not, find the 'Done' field in the 'Properties Pane', right-click and open the 'Field Properties':
 
on the right side of the dialogue box expand 'Equations' & in the first box (Auto-assign rules) add the following:
AM:[ItemColor]="12632256"|E:[ItemColor]=
 
IIRC, A (in 'AM') means when field is ticked or has characters (initially) added; M means when field is edited; E means when field content is deleted.
In the above example, when date is added to the done field, or if the date is changed, the background turns grey. If the Done field content is deleted, the item back color is removed.
 
See also [Node:128]
Tom

Tom

2017/11/23 15:17

In reply to by Tom

Re colours, I only changed the colour in that equation a while back, but cant remember where I got that code for the grey. Named colours can be added in Options/General (there should be a bunch of colours there already). Then one only needs to use the colour name in equations.
 
There is a sample colour list in the manual:

Hi Maciej,
 
Thanks Tom for your answer. For strikethrough, it can probably be done with conditional formatting, but I recommend using auto-assign rules, as the format will be shown for all grids. Add the following to the Done field auto-assign rules:
AM:[ItemFont] = SetFontAttrib([ItemFont],"S",True) |
E:[ItemFont] = SetFontAttrib([ItemFont],"S",False) 
 
[edit] Normally you should be able to select a bunch of items and touch the done field to update the font. 2 issues with that feature prevent this from working:
  • Coding error in SetFontAttrib function
  • Incorrect handling of the touch feature when the value is null: executes the M flag, instead of the E flag
Both of these are fixed in v105b
[/edit]
 
Pierre_Admin
IQ Designer
 

Armando

2017/11/23 19:52

In reply to by Pierre_Admin

I use conditional formatting for most formatting. 
 
As Pierre says, strikethrough/strikeout (or any formatting) won't show if the conditional field isn't included in the grid. But it's easy to add fields to grids and hide* them or even remove them.
Actually, the fact that strikethrough doesn't necessarily show can be an advantage, depending on the context. I personally like that freedom -- and it's simple to use. 
 
1- So, for strikethrough using conditional formatting... In the item field, add this to the conditional formatting area.
 
CRITERIA FORMATS
 
[Done]<>0 strikeout=1|forecolor=&HC0C0C0
 
this will strikeout and grey the characters. 
 
2- And add the done field to grids where you want the conditional formatting to be effective.  
 
(When conditional formatting is heavily used -- like in my case -- it can be edited in notepad : right click on the column headers of the conditional formatting area and select "edit in notepad". After you can just load it back, using a similar process)
 
*A field can be there (added to the grid) BUT *hidden*. Hiding or removing a field from a grid aren't the same.
 
 

Pierre_Admin

2017/11/23 19:59

In reply to by Armando

[quote=Armando]
Actually, the fact that strikethrough doesn't necessarily show can be an advantage, depending on the context. I personally like that freedom -- and it's simple to use. 
[/quote]
Excellent point Armando. I was never a big fan of strikethrough for done items (in IQ and in other apps), but with this neat trick, perhaps one can get the best of both worlds !
 
Pierre_Admin
IQ Designer
 

 Maciej,

Just to supplement what Pierre and Armando have said, here is a screenshot of how I did it using conditional formatting, after I asked them a similar question some time back.  So in my example based on my custom status field, items get changed to various colors.  Beware, unless things have changed, I have often found IQ to be case sensitive (citeria column) when doing things like this.

As Pierre mentioned, this method does require that the column (in this case "status") be visible in the grid in order for the conditional formatting to work.  But since I use "status" in every grid, it's not an issue for me.

HTH

p.s. don't let the name of "status grid" in the screenshot confuse you, that's really just the name of a field.

Thank you, guys. Seem to be working.
 
Still trying to colour calendar events once the item is marked done. I have edited several fields, but it seems none of them is responsible for displaying the calendar items. 
 
Do you have any experience with colouring calendar items conditionally?
 
 
Maciej

Pierre_Admin

2017/11/29 09:14

In reply to by MaciejWasyluk

[quote=MaciejWasyluk]
Still trying to colour calendar events once the item is marked done.
[/quote]
Calendar events backcolor is set by the back color field, normally this is the ItemColor field
 
 
Pierre_Admin
IQ Designer
 

This is what I am using now in the done field auto-asing rule:
 

AM:[ItemColor]="2171945"|E:[ItemColor]=

AM:[ItemFont] = SetFontAttrib([ItemFont],"S",True)|E:[ItemFont] = SetFontAttrib([ItemFont],"S",False)

AM:[ItemForeColor]="8421504"|E:[ItemForeColor]=

 

It works perfectly fine.

Hi, I am new to the forum, and want to report a bug. But I can only comment on an existing thread. Can someone please start a new thread with the following (related) bug?

Bug in function: SetFontAttrib
Description: SetFontAttrib does not return the proper font string when there are multiple attributes (for example, an item that is Bold AND Italic)
Example: ItemFont = "|B|I|". Calling SetFontAttrib([ItemFont],"B",False) returns "I|" (incorrect), instead of "|I|" (correct)
Cause: This line of code in the function is the culprit:
elseif i>0 and value=0 then s=replace(itemfont,s2,"")

By the way, as a task manager/PIM junkie, I have sought for many, many years for an ideal task manager--I've tried Notion, Airtable, Dendron, RTM, OneNote, Evernote, workflowy, etc... The learning curve for InfoQube was steep, but well worth it. For me, nothing else comes close to the power, adaptability, and flexibility of InfoQube. Great job, Pierre!

Hi Patrick,

First a warm welcome to the IQ community. Your account has now been approved, so feel free to start new threads.

Regarding your issue, you can override the stock function with your own. Just add a function with the same name in User code or This Database tab. If you get this to work correctly, please share it with us and I'll include it as the stock function

(see: 7. Visual Basic Editor)

Pierre_Admin
IQ Designer

Hi, following is my fix (I've done some limited testing). Only material change is the line identified as the culprit line in my earlier comment. I also cleaned up the last 4 or so lines in the code just to make it cleaner but they are unnecessary. I put in copious comments mostly to document the logic to prove to myself that the fix is correct--please feel free to remove these comments or clean them up before distribution.

 

public Function SetFontAttrib(ItemFont,Attrib,Value)

  dim i, s, s2

 

  if isnull(ItemFont) then ItemFont="|" 'Seed ItemFont with a single vertical Pipe

  s2="|" & Attrib & "|"

 

  i=instr(ItemFont,s2)

  if i=0 and value=-1 then 'Attribute not found in itemFont and need to add (append) it

     s=ItemFont & s2     'In case s is ||B|, the last piece of logic in this module fixes s

  elseif i>0 and value=0 then s=replace(ItemFont,s2,"|") 'Attribute in ItemFont and need to strip it

  ' 3 cases: a) Attribute is in the middle of ItemFont -- Example: Change |9|B|I| to |9|I|

  '          b) Attribute is at either end of ItemFont -- Example: Change |B|I| to |I|

  '          c) Attribute is by itself -- Change |B| to |. But the last piece of logic in this module fixes this case

  else s=ItemFont  'All other cases, keep ItemFont as is, which could be |

  end if

 

' Cleanup. Need to clean s in case it is "||B|" or "|"

  if s="|" then 'Fixes case c) above

     s=""

  else s=replace(s,"||","|") 'Fixes in case s = "||B|" (see above)

  end if

 

  SetFontAttrib=s

end Function