Skip to content
Snippets Groups Projects
Commit 376ea27a authored by rswindell's avatar rswindell
Browse files

Revamped pop-up menu: added refresh menu item and keyboard short-cuts for all.

parent a10fe85b
No related branches found
No related tags found
No related merge requests found
......@@ -355,8 +355,11 @@ void __fastcall TNodeForm::TimerTick(TObject *Sender)
AnsiString Str=AnsiString(str);
if(ListBox->Items->Count<n+1)
ListBox->Items->Add(Str);
else if(ListBox->Items->Strings[n]!=Str)
else if(ListBox->Items->Strings[n]!=Str) {
bool selected=ListBox->Selected[n]; // save selected state
ListBox->Items->Strings[n]=str;
ListBox->Selected[n]=selected; // restore
}
}
Timer->Enabled=true;
}
......@@ -375,6 +378,7 @@ void __fastcall TNodeForm::InterruptNodeButtonClick(TObject *Sender)
node.misc^=NODE_INTR;
putnodedat(&MainForm->cfg,i+1,&node);
}
TimerTick(Sender);
}
//---------------------------------------------------------------------------
......@@ -389,6 +393,7 @@ void __fastcall TNodeForm::LockNodeButtonClick(TObject *Sender)
node.misc^=NODE_LOCK;
putnodedat(&MainForm->cfg,i+1,&node);
}
TimerTick(Sender);
}
//---------------------------------------------------------------------------
......@@ -403,16 +408,11 @@ void __fastcall TNodeForm::RerunNodeButtonClick(TObject *Sender)
node.misc^=NODE_RRUN;
putnodedat(&MainForm->cfg,i+1,&node);
}
TimerTick(Sender);
}
//---------------------------------------------------------------------------
void __fastcall TNodeForm::ListBoxKeyPress(TObject *Sender, char &Key)
{
if(Key==1) // ctrl-a
SelectAllMenuItemClick(Sender);
}
//---------------------------------------------------------------------------
void __fastcall TNodeForm::SelectAllMenuItemClick(TObject *Sender)
{
......@@ -440,6 +440,7 @@ void __fastcall TNodeForm::DownButtonClick(TObject *Sender)
node.misc^=NODE_DOWN;
putnodedat(&MainForm->cfg,i+1,&node);
}
TimerTick(Sender);
}
//---------------------------------------------------------------------------
......@@ -454,6 +455,7 @@ void __fastcall TNodeForm::ClearErrorButtonClick(TObject *Sender)
node.errors=0;
putnodedat(&MainForm->cfg,i+1,&node);
}
TimerTick(Sender);
}
//---------------------------------------------------------------------------
......@@ -478,6 +480,7 @@ void __fastcall TNodeForm::ChatButtonClick(TObject *Sender)
);
WinExec(str,SW_SHOWNORMAL);
}
TimerTick(Sender);
}
//---------------------------------------------------------------------------
......@@ -495,6 +498,7 @@ void __fastcall TNodeForm::SpyButtonClick(TObject *Sender)
}
SpyForms[i]->Show();
}
TimerTick(Sender);
}
//---------------------------------------------------------------------------
......@@ -515,6 +519,7 @@ void __fastcall TNodeForm::UserEditButtonClick(TObject *Sender)
,node.useron);
WinExec(str,SW_SHOWNORMAL);
}
TimerTick(Sender);
}
//---------------------------------------------------------------------------
......@@ -538,6 +543,14 @@ void __fastcall TNodeForm::UserMsgButtonClick(TObject *Sender)
}
}
delete UserMsgForm;
TimerTick(Sender);
}
//---------------------------------------------------------------------------
void __fastcall TNodeForm::RefreshMenuItemClick(TObject *Sender)
{
ListBox->Clear();
TimerTick(Sender);
}
//---------------------------------------------------------------------------
object NodeForm: TNodeForm
Left = 579
Top = 396
Left = 340
Top = 159
Width = 277
Height = 214
Caption = 'Nodes'
......@@ -10,15 +10,15 @@ object NodeForm: TNodeForm
DragMode = dmAutomatic
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Height = -14
Font.Name = 'MS Sans Serif'
Font.Style = []
OldCreateOrder = False
Position = poDefault
OnHide = FormHide
OnShow = FormShow
PixelsPerInch = 96
TextHeight = 13
PixelsPerInch = 120
TextHeight = 16
object Toolbar: TToolBar
Left = 0
Top = 0
......@@ -118,13 +118,12 @@ object NodeForm: TNodeForm
Left = 0
Top = 25
Width = 269
Height = 162
Height = 157
Align = alClient
ItemHeight = 13
ItemHeight = 16
MultiSelect = True
PopupMenu = PopupMenu
TabOrder = 1
OnKeyPress = ListBoxKeyPress
end
object Timer: TTimer
OnTimer = TimerTick
......@@ -137,53 +136,68 @@ object NodeForm: TNodeForm
object LockMenuItem: TMenuItem
Caption = 'Lock Node'
ImageIndex = 19
ShortCut = 16460
OnClick = LockNodeButtonClick
end
object DownMenuItem: TMenuItem
Caption = 'Down Node'
ImageIndex = 21
ShortCut = 16452
OnClick = DownButtonClick
end
object RerunMenuItem: TMenuItem
Caption = 'Rerun Node'
ImageIndex = 55
ShortCut = 16466
OnClick = RerunNodeButtonClick
end
object InterruptMenuItem: TMenuItem
Caption = 'Interrupt Node'
ImageIndex = 17
ShortCut = 16457
OnClick = InterruptNodeButtonClick
end
object ClearErrorsMenuItem: TMenuItem
Caption = 'Clear Errors'
ImageIndex = 33
ShortCut = 46
OnClick = ClearErrorButtonClick
end
object ChatMenuItem: TMenuItem
Caption = 'Chat w/User'
ImageIndex = 39
ShortCut = 121
OnClick = ChatButtonClick
end
object SendMsgMenuItem: TMenuItem
Caption = 'Send User Msg'
ShortCut = 122
OnClick = UserMsgButtonClick
end
object SpyMenuItem: TMenuItem
Caption = 'Spy on Node'
ImageIndex = 41
ShortCut = 123
OnClick = SpyButtonClick
end
object EditUser1: TMenuItem
Caption = 'Edit User'
Hint = 'EditUserMenuItem'
ImageIndex = 27
ShortCut = 113
OnClick = UserEditButtonClick
end
object N1: TMenuItem
Caption = '-'
end
object RefreshMenuItem: TMenuItem
Caption = 'Refresh'
ShortCut = 116
OnClick = RefreshMenuItemClick
end
object SelectAllMenuItem: TMenuItem
Caption = 'Select &All'
ShortCut = 16449
OnClick = SelectAllMenuItemClick
end
end
......
......@@ -78,12 +78,12 @@ __published: // IDE-managed Components
TMenuItem *EditUser1;
TToolButton *UserMsgButton;
TMenuItem *SendMsgMenuItem;
TMenuItem *RefreshMenuItem;
void __fastcall FormShow(TObject *Sender);
void __fastcall TimerTick(TObject *Sender);
void __fastcall FormHide(TObject *Sender);
void __fastcall InterruptNodeButtonClick(TObject *Sender);
void __fastcall LockNodeButtonClick(TObject *Sender);
void __fastcall ListBoxKeyPress(TObject *Sender, char &Key);
void __fastcall SelectAllMenuItemClick(TObject *Sender);
void __fastcall DownButtonClick(TObject *Sender);
void __fastcall ClearErrorButtonClick(TObject *Sender);
......@@ -92,6 +92,7 @@ __published: // IDE-managed Components
void __fastcall RerunNodeButtonClick(TObject *Sender);
void __fastcall UserEditButtonClick(TObject *Sender);
void __fastcall UserMsgButtonClick(TObject *Sender);
void __fastcall RefreshMenuItemClick(TObject *Sender);
private: // User declarations
public: // User declarations
__fastcall TNodeForm(TComponent* Owner);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment