  'GRAFIDE.O2BAS
  'derived from finded

  '============
  'SEARCH FILES
  '============

  '00:00 22/03/2014
  '20:55 17/03/2017
  '16:00 20/10/2018
  '18:59 03/08/2019
  '13:44 26/03/2022
  '13:44 20/06/2022
  '12:04 01/10/2022
  '
  '17:57 04/04/2023
  '13:20 06/04/2023
  '
  'Charles E V Pegge

  #compact
  #case capital

  typedef long  LONG
  typedef uint  UINT
  typedef dword DWORD
  typedef wchar WCHAR
  typedef short SHORT
  typedef word  WORD
  typedef byte  BYTE


  % Title "OBJ VIEWER (F1 Help  F5 Render)"
  % CustomWndProc
 '% WindowOpacity 240 'max 255
 '% Animated
  % ScaleUp
 '% PlaceCentral
 '% AnchorCentral
  % NoEscape
  % ColorCodedPick
  % MultiSamples 4

  def DisplayHelp
  ===============
  '
  string s= "HOW TO USE:" cr cr +
  "In the top line, Enter keywords or phrases separated by 2 commas ,," cr +
  "then press Enter to execute search." cr cr +

  "Click on filename to get list of line numbers" cr cr +
  "Click on line number to scroll down to the line" cr cr +
  "Search groups can be edited in the left-most panel, and these" cr +
  "will be retained for future use in tools/peroxide.cfg." cr cr +

   "F3 actions a key search 

   F4 actions a  whole-word search" cr cr+

  "Each search-group is separated by a blank line. A search-group is" cr+
  "selected by clicking on the first line in the group" cr cr+

  "The keywords are not case-sensitive" cr cr+

  "Files can be edited. Press F9 or ctrl-s to save the file after editing." cr cr+
  ".o2bas Files can be run. Press F5 or ctrl-e to run the selected file." cr
  MessageBox 0,s,"Instructions",MB_ICONINFORMATION

  end def



  def MessageLoopProcesses
  ========================
      if wm.message=WM_KEYDOWN
        select wm.wparam
        '
        case 0x1B 'Esc
          SendMessage hwnd,WM_DESTROY,0,0 
          continue do
        case 83 'S
          if GetAsyncKeyState(VK_CONTROL) and 0x8000
            SendMessage hWnd,WM_COMMAND, 4002, 0 'to save file
            continue do
          endif
        case 69 'E
          if GetAsyncKeyState(VK_CONTROL) and 0x8000
            SendMessage hWnd,WM_COMMAND, 4003, 0 'to run file
            continue do
          endif
        case VK_F9 'save file
          SendMessage hWnd,WM_COMMAND, 4002, 0 'to save file
          continue do
        case VK_F5 'exec file
          SendMessage hWnd,WM_COMMAND, 4003, 0 'to run file
          continue do
        case VK_F2 'color
          SendMessage hWnd,WM_COMMAND, 4005, 0 'to colorize
          continue do
        case VK_F1
          DisplayHelp
          continue do
        case VK_F3 '
         SendMessage hWnd,WM_COMMAND, 4001, 0 'to execute search
        case VK_F4 '
         SendMessage hWnd,WM_COMMAND, 4004, 0 'to execute word search
        case 0x0D 'CR / Enter
          if wm.hwnd=w[4]
            SendMessage hWnd,WM_COMMAND, 4001, 0 'to execute search
            continue do
          endif
        end select
      endif
  end def

  int width=1000
  int height=400

  string cfgs="grafide.cfg"
  'sys w[16] 'richutil and grafide child windows

  'INCLUDES
  =========
  #case capital
  $filename "graphide.exe"
  'uses rtl64
  'uses oxide.res
  uses corewin
  uses richutil
  uses searchutil
  uses ConsoleG
  uses ObjInterp
  uses GrafideGui
  uses ObjConsole
  EndScript



