Changeset 460 for cprs/branches/foia-cprs/CPRS-Chart/fProbs.pas
- Timestamp:
- Jul 6, 2008, 8:20:14 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
cprs/branches/foia-cprs/CPRS-Chart/fProbs.pas
r459 r460 79 79 mnuChartSurgery: TMenuItem; 80 80 HeaderControl: THeaderControl; 81 mnuViewInformation: TMenuItem; 82 mnuViewDemo: TMenuItem; 83 mnuViewVisits: TMenuItem; 84 mnuViewPrimaryCare: TMenuItem; 85 mnuViewMyHealtheVet: TMenuItem; 86 mnuInsurance: TMenuItem; 87 mnuViewFlags: TMenuItem; 88 mnuViewReminders: TMenuItem; 89 mnuViewRemoteData: TMenuItem; 90 mnuViewPostings: TMenuItem; 91 mnuOptimizeFields: TMenuItem; 81 92 procedure mnuChartTabClick(Sender: TObject); 82 93 procedure lstProbPickClick(Sender: TObject); … … 110 121 procedure FormMouseMove(Sender: TObject; Shift: TShiftState; X, 111 122 Y: Integer); 123 procedure ViewInfo(Sender: TObject); 124 procedure mnuViewInformationClick(Sender: TObject); 125 procedure mnuOptimizeFieldsClick(Sender: TObject); 126 procedure HeaderControlSectionClick(HeaderControl: THeaderControl; 127 Section: THeaderSection); 128 procedure HeaderControlMouseUp(Sender: TObject; Button: TMouseButton; 129 Shift: TShiftState; X, Y: Integer); 130 procedure HeaderControlMouseDown(Sender: TObject; Button: TMouseButton; 131 Shift: TShiftState; X, Y: Integer); 132 function getTotalSectionsWidth : integer; 133 procedure setSectionWidths; 134 procedure sptHorzMoved(Sender: TObject); 112 135 private 113 136 FContextString: string; … … 179 202 GridColWidths: Array[0..15] of integer =(0, 5, -1, 9, 9, 0, 12, 12, 12, 0, 0, 0, 0, 0, 0, 0); 180 203 204 type 205 arOrigSecWidths = array[0..15] of integer; 206 181 207 var 182 208 frmProblems: TfrmProblems; … … 185 211 gFontWidth: Integer; 186 212 gFixedWidth: Integer; 213 origWidths: arOrigSecWidths; 187 214 188 215 implementation … … 544 571 exit; 545 572 end ; 573 if ProbRec.CmtIsXHTML then 574 begin 575 InfoBox(ProbRec.CmtNoEditReason, 'Unable to add new comment', MB_ICONWARNING or MB_OK); 576 exit; 577 end ; 546 578 cmt := NewComment ; 547 579 if (StrToInt(Piece(cmt, U, 1)) > 0) and (Piece(cmt, U, 3) <> '') then … … 882 914 HeaderControl.Sections[AdjustCol].AutoSize := True; 883 915 HeaderControl.Sections[AdjustCol].Width := HeaderControl.Width - cxUsed; 916 //mnuOptimizeFieldsClick(self); //******** test making compression, proportional, or no spacing on resize 884 917 end; 885 918 … … 1586 1619 end ; 1587 1620 lstProbActsClick(Self) ; 1621 mnuOptimizeFieldsClick(self); 1588 1622 end; 1589 1623 … … 1728 1762 if Assigned(dlgProbs) then 1729 1763 dlgProbs.SetFontSize( MainFontSize); 1764 mnuOptimizeFieldsClick(self); 1730 1765 end; 1731 1766 … … 1810 1845 inherited; 1811 1846 wgProbData.Invalidate; 1847 {FEvtColWidth := HeaderControl.Sections[0].Width; //code from fOrders 1848 RedrawSuspend(Self.Handle); 1849 //RedrawOrderList; 1850 RedrawActivate(Self.Handle); 1851 wgProbData.Invalidate; 1852 pnlRight.Refresh; 1853 pnlLeft.Refresh; } 1812 1854 end; 1813 1855 … … 1929 1971 end; 1930 1972 1973 procedure TfrmProblems.ViewInfo(Sender: TObject); 1974 begin 1975 inherited; 1976 frmFrame.ViewInfo(Sender); 1977 end; 1978 1979 procedure TfrmProblems.mnuViewInformationClick(Sender: TObject); 1980 begin 1981 inherited; 1982 mnuViewDemo.Enabled := frmFrame.pnlPatient.Enabled; 1983 mnuViewVisits.Enabled := frmFrame.pnlVisit.Enabled; 1984 mnuViewPrimaryCare.Enabled := frmFrame.pnlPrimaryCare.Enabled; 1985 mnuViewMyHealtheVet.Enabled := not (Copy(frmFrame.laMHV.Hint, 1, 2) = 'No'); 1986 mnuInsurance.Enabled := not (Copy(frmFrame.laVAA2.Hint, 1, 2) = 'No'); 1987 mnuViewFlags.Enabled := frmFrame.lblFlag.Enabled; 1988 mnuViewRemoteData.Enabled := frmFrame.lblCirn.Enabled; 1989 mnuViewReminders.Enabled := frmFrame.pnlReminders.Enabled; 1990 mnuViewPostings.Enabled := frmFrame.pnlPostings.Enabled; 1991 end; 1992 1993 procedure TfrmProblems.mnuOptimizeFieldsClick(Sender: TObject); 1994 var 1995 totalSectionsWidth, unitvalue: integer; 1996 begin 1997 totalSectionsWidth := pnlRight.Width - 3; 1998 if totalSectionsWidth < 16 then exit; 1999 unitvalue := round(totalSectionsWidth / 16); 2000 with HeaderControl do 2001 begin 2002 if Sections[1].Width > 0 then Sections[1].Width := unitvalue; 2003 Sections[2].Width := pnlRight.Width - (unitvalue * 11) - 5; 2004 Sections[3].Width := unitvalue * 2; 2005 Sections[4].Width := unitvalue * 2; 2006 if Sections[6].Width > 0 then Sections[6].Width := unitvalue; 2007 if Sections[7].Width > 0 then Sections[7].Width := unitvalue * 2; 2008 if Sections[8].Width > 0 then Sections[8].Width := unitvalue * 2; 2009 if Sections[15].Width > 0 then Sections[15].Width := unitvalue; 2010 end; 2011 HeaderControlSectionResize(HeaderControl, HeaderControl.Sections[0]); 2012 HeaderControl.Repaint; 2013 end; 2014 2015 procedure TfrmProblems.HeaderControlSectionClick( 2016 HeaderControl: THeaderControl; Section: THeaderSection); 2017 begin 2018 inherited; 2019 //if Section = HeaderControl.Sections[1] then 2020 mnuOptimizeFieldsClick(self); 2021 end; 2022 2023 procedure TfrmProblems.HeaderControlMouseUp(Sender: TObject; 2024 Button: TMouseButton; Shift: TShiftState; X, Y: Integer); 2025 var 2026 i: integer; 2027 totalSectionsWidth, originalwidth: integer; 2028 begin 2029 inherited; 2030 totalSectionsWidth := getTotalSectionsWidth; 2031 if totalSectionsWidth > wgProbData.Width - 5 then 2032 begin 2033 originalwidth := 0; 2034 for i := 0 to HeaderControl.Sections.Count - 1 do 2035 originalwidth := originalwidth + origWidths[i]; 2036 if originalwidth < totalSectionsWidth then 2037 begin 2038 for i := 0 to HeaderControl.Sections.Count - 1 do 2039 HeaderControl.Sections[i].Width := origWidths[i]; 2040 wgProbData.Invalidate; 2041 end; 2042 end; 2043 end; 2044 2045 function TfrmProblems.getTotalSectionsWidth : integer; 2046 var 2047 i: integer; 2048 begin 2049 Result := 0; 2050 for i := 0 to HeaderControl.Sections.Count - 1 do 2051 Result := Result + HeaderControl.Sections[i].Width; 2052 end; 2053 2054 procedure TfrmProblems.HeaderControlMouseDown(Sender: TObject; 2055 Button: TMouseButton; Shift: TShiftState; X, Y: Integer); 2056 begin 2057 inherited; 2058 setSectionWidths; 2059 end; 2060 2061 procedure TfrmProblems.setSectionWidths; 2062 var 2063 i: integer; 2064 begin 2065 for i := 0 to 15 do 2066 origWidths[i] := HeaderControl.Sections[i].Width; 2067 end; 2068 2069 procedure TfrmProblems.sptHorzMoved(Sender: TObject); 2070 begin 2071 inherited; 2072 mnuOptimizeFieldsClick(self); 2073 end; 2074 1931 2075 end. 1932 2076
Note:
See TracChangeset
for help on using the changeset viewer.