with os2 ; use os2 ;  
with os2.jba; use os2.jba;  
with os2.pmwd; use os2.pmwd ;
with os2.pmwb; use os2.pmwb ;
with os2.pmsc; use os2.pmsc ;
with System.Address_To_Access_Conversions;
with System.Storage_Elements;
package body LISTDP is 
package To_PSWP is new  System.Address_To_Access_Conversions(SWP);
package To_PWIN is new  System.Address_To_Access_Conversions(WINDOW);
mp_1 :System.Storage_Elements.Integer_Address ; 
mp_2 :System.Storage_Elements.Integer_Address ; 
mp1l:Long ; 
mp2l:Long ; 
m_Result : Ulong := 0;
p_Swp    : PSWP ; 
pWin     : PWINDOW ; 
-- ΙΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝ» 
-- Ί     DLG_ListBoxWndProc                               Ί
-- Ί                                                      Ί 
-- ΘΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΌ 

function  DLG_ListBoxWndProc (h_wnd:HWND;msg:ULONG;mp1:PMPARAM;mp2:PMPARAM)return PMENTRY is
begin null;
mp_1:= System.Storage_Elements.To_Integer(mp1) ; 
mp_2:= System.Storage_Elements.To_Integer(mp2) ; 
mp1l:= Long(SHORT1FROMMP(mp1)); 
mp2l:= Long(SHORT2FROMMP(mp1)); 
    if  msg = WM_GUIGETWINDOW then
        pWin := PWINDOW(To_PWIN.To_Pointer(mp2));  -- address WINDOW
        pWin.all :=  wDLG_ListBox; 
        return 0 ;
    end if ; 
     -- Check if window fully loaded    
     if    wDLG_ListBox.h_wnd   = 0 then 
         return  GuiDefFrameProc (WinDefDlgProc'address , h_wnd, msg, mp1, mp2) ; 
     end if;
     case msg is 
 -- Property processing * 
         when  WM_GUIGETPROPERTY => Null ; 
         when  WM_GUISETPROPERTY => Null ; 
               -- break
 -- Window resized/repositioned * 
         when  WM_WINDOWPOSCHANGED => Null ; 
         p_Swp := PSWP(To_PSWP.To_Pointer(mp1));  -- address SWP struct in mp1
         if  (p_Swp.fl and SWP_SIZE)  > 0 then
             GuiBroadcastMsg (h_wnd, WM_GUIPARENTRESIZED,
             System.Null_Address,System.Null_Address ); 
         end if ; 
               -- break
 -- User command processing * 
         when  WM_COMMAND => Null ; 
              case mp1l is 
                  when  IDD_PSH_APPEND => Null ; 
                       DLG_ListBoxPSH_AppendClick  ; 
                        -- break
                  when  IDD_PSH_INSERT => Null ; 
                       DLG_ListBoxPSH_InsertClick  ; 
                        -- break
                  when  IDD_PSH_CLEAR => Null ; 
                       DLG_ListBoxPSH_ClearClick  ; 
                        -- break
                  when  IDD_PSH_DELETE => Null ; 
                       DLG_ListBoxPSH_DeleteClick  ; 
                        -- break
                  when  IDD_PSH_ALL => Null ; 
                       DLG_ListBoxPSH_AllClick  ; 
                        -- break
                  when  IDD_PSH_NONE => Null ; 
                       DLG_ListBoxPSH_NoneClick  ; 
                        -- break
                  when  IDD_PSH_SETTEXT => Null ; 
                       DLG_ListBoxPSH_SetTextClick  ; 
                        -- break
                  when others => Null;
                        -- break
              end case ;
              return  m_Result ; 
 -- Window is being loaded * 
         when  WM_GUIWINDOWLOADED => Null ; 
              DLG_ListBoxCreate  ; 
              return  0 ; 
 -- Control notifications * 
         when  WM_CONTROL => Null ; 
--            if   !GuiEventLoop (mp1)  -- not need
                   -- break
              case mp1l is 
                  when  IDD_LST_DEFAULT => Null ; 
                       case mp2l is 
                           when  LN_SELECT => Null ; 
                                DLG_ListBoxLST_DefaultSelect  ; 
                                 -- break
                           when  LN_ENTER => Null ; 
                                DLG_ListBoxLST_DefaultEnter  ; 
                                 -- break
                           when  LN_SCROLL => Null ; 
                                DLG_ListBoxLST_DefaultVScroll  ; 
                                 -- break
                       when others => Null;end case ;
                        -- break
                  when  IDD_LST_MULTI => Null ; 
                       case mp2l is 
                           when  LN_SELECT => Null ; 
                                DLG_ListBoxLST_MultiSelect  ; 
                                 -- break
                           when  LN_SCROLL => Null ; 
                                DLG_ListBoxLST_MultiVScroll  ; 
                                 -- break
                           when others => Null;
                       end case ;
                        -- break
                  when  IDD_LST_EXTENDED => Null ; 
                       case mp2l is 
                           when  LN_SELECT => Null ; 
                                DLG_ListBoxLST_ExtendedSelect  ; 
                                 -- break
                           when  LN_SCROLL => Null ; 
                                DLG_ListBoxLST_ExtendedVScroll  ; 
                                 -- break
                       when others => Null;end case ;
                        -- break
                  when  IDD_LST_HSCROLL => Null ; 
                       case mp2l is 
                           when  LN_SELECT => Null ; 
                                DLG_ListBoxLST_HScrollSelect  ; 
                                 -- break
                           when  LN_ENTER => Null ; 
                                DLG_ListBoxLST_HScrollEnter  ; 
                                 -- break
                           when  LN_SCROLL => Null ; 
                                DLG_ListBoxLST_HScrollVScroll  ; 
                                 -- break
                       when others => Null;end case ;
                        -- break
                  when  IDD_EDT_ITEM => Null ; 
                       case mp2l is 
                           when  EN_CHANGE => Null ; 
                                DLG_ListBoxEDT_ItemChange  ; 
                                 -- break
                       when others => Null;end case ;
                        -- break
                 when others => Null;
              end case ;
 --           GuiEventLoop (0);  -- not need
              return  m_Result ; 
         when others => Null;
               -- break
     end case ;
     return  GuiDefFrameProc (WinDefDlgProc'address , h_wnd, msg, mp1, mp2) ; 
End DLG_ListBoxWndProc ;
-- ΙΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝ» 
-- Ί     DLG_ListBoxPSH_AppendClick                       Ί
-- Ί                                                      Ί 
-- ΘΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΌ 
procedure DLG_ListBoxPSH_AppendClick   is
GuiTmp1 :  SHORT :=  0; 
GuiTmp2 :  SHORT :=  0; 
GuiTmp3 :  SHORT :=  0; 
GuiTmp4 :  SHORT :=  0; 
number  :  SHORT :=  i + 10 ;
begin       
     GuiTmp1 := 1; 
     loop
         GuiTmp2 := 1; 
         if  GuiTmp1 = 1   then
             GuiTmp1 := 0; 
  --         i := i;
         else 
             i  := i +  GuiTmp2; 
         end if ;
 --      if  (GuiTmp2 > 0) ? (i > number) : (i < number) -- WARNING change  manualy
        if (GuiTmp2>0 and i> number) or (GuiTmp2=0 and i < number)
        then exit;
        end if;

         GuiTmp3 := 1; 
         loop
             GuiTmp4 := 1; 
             if  GuiTmp3 = 1   then
                 GuiTmp3 := 0; 
                 k :=  0; 
             else 
                 k  := k +  GuiTmp4; 
             end if ;
--           if  (GuiTmp4 > 0) ? (k >  3) : (k <  3) -- WARNING change  manualy
             exit when (GuiTmp4 > 0 and k>3) or ( GuiTmp4 = 0 and k < 3 );                  -- break
             if GuiInsertItem (Listbox(integer(k))'unchecked_access, -1,
                 "Append: "  & short'image(i + 1) ) > 0
             then null; end if;
         end loop ;
     end loop ;
     UpdateStats  ; 
End DLG_ListBoxPSH_AppendClick ;
-- ΙΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝ» 
-- Ί      DLG_ListBoxPSH_InsertClick                      Ί
-- Ί                                                      Ί 
-- ΘΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΌ 
procedure DLG_ListBoxPSH_InsertClick   is
GuiTmp1 :  SHORT :=  0; 
GuiTmp2 :  SHORT :=  0; 
begin       
     GuiTmp1 := 1; 
     loop
         GuiTmp2 := 1; 
         if  GuiTmp1 = 1   then   GuiTmp1 := 0;     k :=  0; 
         else 
             k  := k +  GuiTmp2; 
         end if ;
--       if  (GuiTmp2 > 0) ? (k >  3) : (k <  3) -- WARNING change  manualy
         exit when ( GuiTmp2 > 0 and k > 3 ) or ( GuiTmp2 = 0 and k < 3 );
         if GuiInsertItem (Listbox(integer(k))'unchecked_access,
               GuiGetShort (Listbox(integer(k))'unchecked_access,WPID_LISTBOXSEL),
               "Insert: " & short'image(j + 1))  > 0 then null;
         end if;                                                                 
     end loop ;
     j :=  j + 1 ;
     UpdateStats  ; 
End DLG_ListBoxPSH_InsertClick ;
-- ΙΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝ» 
-- Ί     DLG_ListBoxPSH_DeleteClick                       Ί
-- Ί                                                      Ί 
-- ΘΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΌ 
procedure DLG_ListBoxPSH_DeleteClick   is
GuiTmp1 :  SHORT :=  0; 
GuiTmp2 :  SHORT :=  0; 
index   :  SHORT :=  0;
begin       
     GuiTmp1 := 1; 
     loop
         GuiTmp2 := 1; 
         if  GuiTmp1 = 1   then  GuiTmp1 := 0;  k :=  0; 
                           else      k  := k +  GuiTmp2;
         end if ;
 --      if  (GuiTmp2 > 0) ? (k >  3) : (k <  3) -- WARNING change  manualy
         exit when (GuiTmp2 > 0 and k > 3) or ( GuiTmp2 = 0 and k < 3 ) ;

         index := GuiGetShort (Listbox(integer(k))'unchecked_access,
                               WPID_LISTBOXSEL);
         loop
             if   not ( index /= -1) then exit; end if;
                  -- break
             GuiDeleteItem (Listbox(integer(k))'unchecked_access, index);
             index := GuiGetShort (Listbox(integer(k))'unchecked_access,
                                   WPID_LISTBOXSEL);
         end loop ;
     end loop ;
     UpdateStats  ; 
End DLG_ListBoxPSH_DeleteClick ;
-- ΙΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝ» 
-- Ί   DLG_ListBoxCreate                                  Ί
-- Ί                                                      Ί 
-- ΘΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΌ 
procedure DLG_ListBoxCreate   is
GuiTmp1 : aliased WINDOW ;
GuiTmp2 : aliased WINDOW ;
GuiTmp3 : aliased WINDOW ;
begin       
     GuiSetControl (wDLG_ListBox'unchecked_access, Listbox(0)'unchecked_access, IDD_LST_DEFAULT, WT_LISTBOX); 
     GuiSetControl (wDLG_ListBox'unchecked_access, Listbox(1)'unchecked_access, IDD_LST_HSCROLL, WT_LISTBOX); 
     GuiSetControl (wDLG_ListBox'unchecked_access, Listbox(2)'unchecked_access, IDD_LST_MULTI, WT_LISTBOX); 
     GuiSetControl (wDLG_ListBox'unchecked_access, Listbox(3)'unchecked_access, IDD_LST_EXTENDED, WT_LISTBOX); 
     GuiSetControl (wDLG_ListBox'unchecked_access, Count(0)'unchecked_access, IDD_LBL_DEFCOUNT, WT_STATICTEXT); 
     GuiSetControl (wDLG_ListBox'unchecked_access, Count(1)'unchecked_access, IDD_LBL_HSCOUNT, WT_STATICTEXT); 
     GuiSetControl (wDLG_ListBox'unchecked_access, Count(2)'unchecked_access, IDD_LBL_MULTCOUNT, WT_STATICTEXT); 
     GuiSetControl (wDLG_ListBox'unchecked_access, Count(3)'unchecked_access, IDD_LBL_EXTCOUNT, WT_STATICTEXT); 
     GuiSetControl (wDLG_ListBox'unchecked_access, Selection(0)'unchecked_access, IDD_LBL_DEFSELECT, WT_STATICTEXT); 
     GuiSetControl (wDLG_ListBox'unchecked_access, Selection(1)'unchecked_access, IDD_LBL_HSSELECT, WT_STATICTEXT); 
     GuiSetControl (wDLG_ListBox'unchecked_access, Selection(2)'unchecked_access, IDD_LBL_MULTSELECT, WT_STATICTEXT); 
     GuiSetControl (wDLG_ListBox'unchecked_access, Selection(3)'unchecked_access, IDD_LBL_EXTSELECT, WT_STATICTEXT); 
     GuiSetControl (wDLG_ListBox'unchecked_access, TopIndex(0)'unchecked_access, IDD_LBL_DEFTOP, WT_STATICTEXT); 
     GuiSetControl (wDLG_ListBox'unchecked_access, TopIndex(1)'unchecked_access, IDD_LBL_HSTOP, WT_STATICTEXT); 
     GuiSetControl (wDLG_ListBox'unchecked_access, TopIndex(2)'unchecked_access, IDD_LBL_MULTTOP, WT_STATICTEXT); 
     GuiSetControl (wDLG_ListBox'unchecked_access, TopIndex(3)'unchecked_access, IDD_LBL_EXTTOP, WT_STATICTEXT); 
     GuiSetControl (wDLG_ListBox'unchecked_access, GuiTmp1'unchecked_access, IDD_PSH_SETTEXT, WT_PUSHBUTTON); 
     GuiSetShort (GuiTmp1'unchecked_access, WPID_ENABLED, 0); 
     GuiSetControl (wDLG_ListBox'unchecked_access, GuiTmp2'unchecked_access, IDD_LBL_CURRLIST, WT_STATICTEXT); 
     GuiSetString (GuiTmp2'unchecked_access, WPID_TEXT, 
                     short'image(currentlistbox));
     GuiSetControl (wDLG_ListBox'unchecked_access, GuiTmp3'unchecked_access, IDD_LBL_CURRLINE, WT_STATICTEXT); 
     GuiSetString (GuiTmp3'unchecked_access, WPID_TEXT, short'image(currentline));
End DLG_ListBoxCreate ;
-- ΙΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝ» 
-- Ί      DLG_ListBoxPSH_ClearClick                       Ί
-- Ί                                                      Ί 
-- ΘΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΌ 
procedure DLG_ListBoxPSH_ClearClick   is
GuiTmp1 :  SHORT :=  0; 
GuiTmp2 :  SHORT :=  0; 
begin       
     GuiTmp1 := 1; 
     loop
         GuiTmp2 := 1; 
         if  GuiTmp1 = 1   then    GuiTmp1 := 0;     k :=  0; 
                           else  k  := k +  GuiTmp2;
         end if ;
 --      if  (GuiTmp2 > 0) ? (k >  3) : (k <  3) -- WARNING change  manualy
         exit when ( GuiTmp2 > 0  and k > 3 ) or ( GuiTmp2 = 0 and k < 3 );              -- break
         GuiClearItems (Listbox(integer(k))'unchecked_access);
     end loop ;
     UpdateStats  ; 
End DLG_ListBoxPSH_ClearClick ;
-- ΙΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝ» 
-- Ί      DLG_ListBoxPSH_AllClick                         Ί
-- Ί                                                      Ί 
-- ΘΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΌ 
procedure DLG_ListBoxPSH_AllClick   is
GuiTmp1    :  SHORT :=  0;
GuiTmp2    :  SHORT :=  0;
GuiTmp3    :  SHORT :=  0;
GuiTmp4    :  SHORT :=  0;
linenumber :  SHORT :=  0; 
begin       
     GuiTmp1 := 1; 
     loop
         GuiTmp2 := 1; 
         if  GuiTmp1 = 1   then  GuiTmp1 := 0;  k :=  0; 
                           else  k  := k +  GuiTmp2;
         end if ;
--       if  (GuiTmp2 > 0) ? (k >  3) : (k <  3) -- WARNING change  manualy
         exit when (GuiTmp2 > 0 and k > 3) or ( GuiTmp2 = 0 and k < 3 ) ;
              -- break
         GuiTmp3 := 1; 
         loop
             GuiTmp4 := 1; 
             if  GuiTmp3 = 1   then  GuiTmp3 := 0;   linenumber :=  0; 
                               else  linenumber  := linenumber +  GuiTmp4;
             end if ;

         exit when (GuiTmp4 > 0 and 
         ( linenumber >
           GuiGetShort (Listbox(integer(k))'unchecked_access, WPID_LISTBOXCOUNT) - 1))
              or
           ( GuiTmp4 = 0 and 
           (linenumber <
             GuiGetShort (Listbox(integer(k))'unchecked_access, WPID_LISTBOXCOUNT) - 1)) ;

             GuiSelectItem (Listbox(integer(k))'unchecked_access, linenumber, 1);
         end loop ;
     end loop ;
     UpdateStats  ; 
End DLG_ListBoxPSH_AllClick ;
-- ΙΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝ» 
-- Ί     DLG_ListBoxPSH_NoneClick                         Ί
-- Ί                                                      Ί 
-- ΘΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΌ 
procedure DLG_ListBoxPSH_NoneClick   is
GuiTmp1    :  SHORT :=  0;
GuiTmp2    :  SHORT :=  0;
GuiTmp3    :  SHORT :=  0;
GuiTmp4    :  SHORT :=  0;
linenumber :  SHORT :=  0;
begin       
     GuiTmp1 := 1; 
     loop
         GuiTmp2 := 1; 
         if  GuiTmp1 = 1   then  GuiTmp1 := 0;   k :=  0; 
                           else  k  := k +  GuiTmp2;
         end if ;
--       if  (GuiTmp2 > 0) ? (k >  3) : (k <  3) -- WARNING change  manualy
         exit when (GuiTmp2 > 0 and k > 3) or ( GuiTmp2 = 0 and k < 3 ) ;
         GuiTmp3 := 1; 
         loop
             GuiTmp4 := 1; 
             if  GuiTmp3 = 1   then  GuiTmp3 := 0;  linenumber :=  0; 
                               else  linenumber  := linenumber +  GuiTmp4;
             end if ;
         exit when (GuiTmp4 > 0 and 
         ( linenumber >
             GuiGetShort (Listbox(integer(k))'unchecked_access, WPID_LISTBOXCOUNT) - 1))
              or
           ( GuiTmp4 = 0 and (linenumber <
             GuiGetShort (Listbox(integer(k))'unchecked_access, WPID_LISTBOXCOUNT) - 1)) ;
             GuiSelectItem (Listbox(integer(k))'unchecked_access, linenumber, 0);
         end loop ;
     end loop ;
     UpdateStats  ; 
End DLG_ListBoxPSH_NoneClick ;
-- ΙΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝ» 
-- Ί      DLG_ListBoxLST_DefaultVScroll                   Ί
-- Ί                                                      Ί 
-- ΘΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΌ 
procedure DLG_ListBoxLST_DefaultVScroll   is
begin null;
     UpdateStats  ; 
End DLG_ListBoxLST_DefaultVScroll ;
-- ΙΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝ» 
-- Ί      DLG_ListBoxLST_DefaultSelect                    Ί
-- Ί                                                      Ί 
-- ΘΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΌ 
procedure DLG_ListBoxLST_DefaultSelect   is
begin null;
     UpdateStats  ; 
End DLG_ListBoxLST_DefaultSelect ;
-- ΙΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝ» 
-- Ί      DLG_ListBoxLST_HScrollSelect                    Ί
-- Ί                                                      Ί 
-- ΘΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΌ 
procedure DLG_ListBoxLST_HScrollSelect   is
begin null;
     UpdateStats  ; 
End DLG_ListBoxLST_HScrollSelect ;
-- ΙΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝ» 
-- Ί      DLG_ListBoxLST_HScrollVScroll                   Ί
-- Ί                                                      Ί 
-- ΘΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΌ 
procedure DLG_ListBoxLST_HScrollVScroll   is
begin null;
     UpdateStats  ; 
End DLG_ListBoxLST_HScrollVScroll ;
-- ΙΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝ» 
-- Ί      DLG_ListBoxLST_MultiSelect                      Ί
-- Ί                                                      Ί 
-- ΘΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΌ 
procedure DLG_ListBoxLST_MultiSelect   is
begin null;
     UpdateStats  ; 
End DLG_ListBoxLST_MultiSelect ;
-- ΙΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝ» 
-- Ί      DLG_ListBoxLST_MultiVScroll                     Ί
-- Ί                                                      Ί 
-- ΘΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΌ 
procedure DLG_ListBoxLST_MultiVScroll   is
begin null;
     UpdateStats  ; 
End DLG_ListBoxLST_MultiVScroll ;
-- ΙΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝ» 
-- Ί      DLG_ListBoxLST_ExtendedSelect                   Ί
-- Ί                                                      Ί 
-- ΘΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΌ 
procedure DLG_ListBoxLST_ExtendedSelect   is
begin null;
     UpdateStats  ; 
End DLG_ListBoxLST_ExtendedSelect ;
-- ΙΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝ» 
-- Ί      DLG_ListBoxLST_ExtendedVScroll                  Ί
-- Ί                                                      Ί 
-- ΘΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΌ 
procedure DLG_ListBoxLST_ExtendedVScroll   is
begin null;
     UpdateStats  ; 
End DLG_ListBoxLST_ExtendedVScroll ;
-- ΙΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝ» 
-- Ί      DLG_ListBoxLST_DefaultEnter                     Ί
-- Ί                                                      Ί 
-- ΘΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΌ 
procedure DLG_ListBoxLST_DefaultEnter   is
begin null;
     GetTheText ( 0); 
End DLG_ListBoxLST_DefaultEnter ;
-- ΙΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝ» 
-- Ί      DLG_ListBoxLST_HScrollEnter                     Ί
-- Ί                                                      Ί 
-- ΘΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΌ 
procedure DLG_ListBoxLST_HScrollEnter   is
begin null;
     GetTheText ( 1); 
End DLG_ListBoxLST_HScrollEnter ;
-- ΙΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝ» 
-- Ί      DLG_ListBoxPSH_SetTextClick                     Ί
-- Ί                                                      Ί 
-- ΘΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΌ 
procedure DLG_ListBoxPSH_SetTextClick   is
GuiTmp1 : aliased WINDOW ;
GuiTmp2 : aliased WINDOW ;
begin       
     GuiSetControl (wDLG_ListBox'unchecked_access, GuiTmp1'unchecked_access, IDD_EDT_ITEM, WT_ENTRYFIELD); 
     GuiSetItemText (Listbox(integer(currentlistbox))'unchecked_access, currentline, GuiStrTrim (GuiGetString (GuiTmp1'unchecked_access, WPID_TEXT)));
     GuiSetControl (wDLG_ListBox'unchecked_access, GuiTmp1'unchecked_access, IDD_EDT_ITEM, WT_ENTRYFIELD); 
     GuiSetString (GuiTmp1'unchecked_access, WPID_TEXT, ""); 
     GuiSetControl (wDLG_ListBox'unchecked_access, GuiTmp2'unchecked_access, IDD_PSH_SETTEXT, WT_PUSHBUTTON); 
     GuiSetShort (GuiTmp2'unchecked_access, WPID_ENABLED, 0); 
End DLG_ListBoxPSH_SetTextClick ;
-- ΙΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝ» 
-- Ί      DLG_ListBoxEDT_ItemChange                       Ί
-- Ί                                                      Ί 
-- ΘΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΌ 
procedure DLG_ListBoxEDT_ItemChange   is
GuiTmp1 : aliased WINDOW ;
GuiTmp2 : aliased WINDOW ;
begin       
     GuiSetControl (wDLG_ListBox'unchecked_access, GuiTmp1'unchecked_access, IDD_EDT_ITEM, WT_ENTRYFIELD); 
     if  GuiStrTrim (GuiGetString (GuiTmp1'unchecked_access, WPID_TEXT)) = ""  then
         GuiSetControl (wDLG_ListBox'unchecked_access, GuiTmp2'unchecked_access, IDD_PSH_SETTEXT, WT_PUSHBUTTON);
         GuiSetShort (GuiTmp2'unchecked_access, WPID_ENABLED, 0);
     else
         GuiSetControl (wDLG_ListBox'unchecked_access, GuiTmp2'unchecked_access, IDD_PSH_SETTEXT, WT_PUSHBUTTON); 
         GuiSetShort (GuiTmp2'unchecked_access, WPID_ENABLED, 1); 
     end if ;
End DLG_ListBoxEDT_ItemChange ;
-- ΙΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝ» 
-- Ί     UpdateStats                                      Ί
-- Ί                                                      Ί 
-- ΘΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΌ 
procedure UpdateStats   is
GuiTmp1 :  SHORT :=  0; 
GuiTmp2 :  SHORT :=  0; 
labelnumber : SHORT :=  0; 
begin       
     GuiTmp1 := 1; 
     loop
         GuiTmp2 := 1; 
         if  GuiTmp1 = 1   then  GuiTmp1 := 0;  labelnumber :=  0; 
                           else  labelnumber  := labelnumber +  GuiTmp2;
         end if ;
--       if  (GuiTmp2 > 0) ? (labelnumber >  3) : (labelnumber <  3) -- WARNING change  manualy
         exit when (GuiTmp2 > 0 and labelnumber > 3) or ( GuiTmp2 = 0 and labelnumber < 3 ) ;
  
         GuiSetString (Count(integer(labelnumber))'unchecked_access, WPID_TEXT, 
 short'image(GuiGetShort (Listbox(integer(labelnumber))'unchecked_access,
           WPID_LISTBOXCOUNT)));
         GuiSetString (Selection(integer(labelnumber))'unchecked_access, WPID_TEXT, 
 short'image(GuiGetShort (Listbox(integer(labelnumber))'unchecked_access, WPID_LISTBOXSEL)));
         GuiSetString (TopIndex(integer(labelnumber))'unchecked_access, WPID_TEXT, 
 short'image (GuiGetShort (Listbox(integer(labelnumber))'unchecked_access, WPID_LISTBOXTOP)));
     end loop ;
End UpdateStats ;
-- ΙΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝ» 
-- Ί      GetTheText                                      Ί
-- Ί                                                      Ί 
-- ΘΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΌ 
procedure GetTheText (number:SHORT) is
GuiTmp1 : aliased WINDOW ;
GuiTmp2 : aliased WINDOW ;
GuiTmp3 : aliased WINDOW ;
begin       
     currentlistbox := number; 
     currentline := GuiGetShort (Listbox(integer(currentlistbox))'unchecked_access, WPID_LISTBOXSEL);
     GuiSetControl (wDLG_ListBox'unchecked_access, GuiTmp1'unchecked_access, IDD_LBL_CURRLIST, WT_STATICTEXT); 
     GuiSetString (GuiTmp1'unchecked_access, WPID_TEXT,short'image (currentlistbox));
     GuiSetControl (wDLG_ListBox'unchecked_access, GuiTmp2'unchecked_access, IDD_LBL_CURRLINE, WT_STATICTEXT); 
     GuiSetString (GuiTmp2'unchecked_access, WPID_TEXT, short'image(currentline));
     GuiSetControl (wDLG_ListBox'unchecked_access, GuiTmp3'unchecked_access, IDD_EDT_ITEM, WT_ENTRYFIELD); 
     GuiSetString (GuiTmp3'unchecked_access, WPID_TEXT, GuiGetItemText (Listbox(integer(currentlistbox))'unchecked_access, currentline));
End GetTheText ;
-- ΙΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝ» 
-- Ί      Listdemo                                        Ί
-- Ί                                                      Ί 
-- ΘΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΌ 
procedure Listdemo (WinOwner:PWINDOW) is
begin null;
--   GuiSetWindow (wDLG_ListBox'unchecked_access, IDD_DLG_LISTBOX, WT_DIALOG, DLG_ListBoxWndProc, (HMODULE)0);
--   GuiLoadWindow (wDLG_ListBox'unchecked_access, WinOwner);
--   GuiProcessWindow (wDLG_ListBox'unchecked_access);
--   GuiUnloadWindow (wDLG_ListBox'unchecked_access);
End Listdemo ;
End LISTDP ;
