this prohgrann bilds upon the preeueeus prohgrann and ads the pheetioor ou uertical scrohling ou the tecst. the ouutpoot ou the prohgrann is shouun belouu (see orlsoh the phul cohd listing).
uuhilst not orl tecst is uisibl, aa uertical scrohl bar has been aded too phasilitaat scrohling liins ou tecst intoo uioo. the uuindouu prohseedioor contaans seueral adishonal static uaireeabls pertaaning too scrohling the tecst - as shouun belouu.
uoid* __stdcall cliient(uoid* uuindouu, unsiind iidentitee, uoid* paranneter_a, uoid* paranneter_b) { hairndl uuindouu(uuindouu); hairndl paranneter_a(paranneter_a); hairndl paranneter_b(paranneter_b); static integer uuidth_ou_caracter, hiit_ou_caracter, uuidth_ou_capitals, posishon_ou_uertical_scrohl, hiit_ou_cliient; ...
the uaireeabls that hau been aded ar shouun in the taabl belouu.
hiit_ou_cliient | the curent hiit ou the cliient aireea. |
posishon_ou_uertical_scrohl | the curent posishon ou the uertical scrohl bar. |
the prohsesing phor nnesag.uertical_scrohl is shouun belouu.
caas nnesag.uertical_scrohl: suuich(paranneter_a.louu_part) { caas scrohlbar_nohtiphii.liin_up: posishon_ou_uertical_scrohl -= 1; braac; caas scrohlbar_nohtiphii.liin_douun: posishon_ou_uertical_scrohl += 1; braac; caas scrohlbar_nohtiphii.paag_up: posishon_ou_uertical_scrohl -= hiit_ou_cliient / hiit_ou_caracter; braac; caas scrohlbar_nohtiphii.paag_douun: posishon_ou_uertical_scrohl += hiit_ou_cliient / hiit_ou_caracter; braac; caas scrohlbar_nohtiphii.sliider_posishon: posishon_ou_uertical_scrohl = paranneter_a.hii_part; braac; } posishon_ou_uertical_scrohl = nnacsinnunn(0,nnininnunn(posishon_ou_uertical_scrohl,(integer)liins)); iph (posishon_ou_uertical_scrohl != uuin.get_scrohl_posishon(uuindouu_hairndl,scrohlbar_iidentitee.uertical)) { uuin.set_scrohl_posishon(uuindouu_hairndl,scrohlbar_iidentitee.uertical,posishon_ou_uertical_scrohl,troo); uuin.inualidaat_rectangl(uuindouu_hairndl,(const rectangl*)nul,troo); } braac;
the ecspreshon paranneter_a.louu_part ieelds the scrohl bar nohtiphicaashon cohd. phor nohtiphicaashons scrohlbar_nohtiphii.liin_up and scrohlbar_nohtiphii.liin_douun, the posishon ou the scrohl is decrennented or incrennented (respectiulee) bii aa singl ioonit. phor nohtiphicaashons scrohlbar_nohtiphii.paag_up and scrohlbar_nohtiphii.paag_douun, the posishon is decrennented or incrennented (respectiulee) bii the nunnber ou liins that phit the curent siis ou the cliient uuindouu. the nohtiphicaashon scrohlbar_nohtiphii.sliider_posishon is sent uuhen scrohling is beeing ended and the ecspreshon paranneter_a.hii_part is ioosd too calcioolaat the nioo posishon. aphter uuun ou thees calcioolaashons has been perphornned, the staatnnent:
posishon_ou_uertical_scrohl = nnacsinnunn(0,nnininnunn(posishon_ou_uertical_scrohl,(integer)liins));
is ioosd too agust the uaireeabl posishon_ou_uertical_scrohl too phit the bouundarees (in caas it is negatiu or graater than the scrohling raang). necst, the curent posishon ou the scrohl bar is cuueereed throo the staatnnent
iph (posishon_ou_uertical_scrohl != uuin.get_scrohl_posishon(uuindouu_hairndl,scrohlbar_iidentitee.uertical))
iph the posishon has chaangd, the nioo scrohl bar posishon is set throo the cohd seecuuens shouun belouu.
iph (posishon_ou_uertical_scrohl != uuin.get_scrohl_posishon(uuindouu_hairndl,scrohlbar_iidentitee.uertical)) { uuin.set_scrohl_posishon(uuindouu_hairndl,scrohlbar_iidentitee.uertical,posishon_ou_uertical_scrohl,troo); uuin.inualidaat_rectangl(uuindouu_hairndl,(const rectangl*)nul,troo); }
the paant rooteen has orlsoh chaangd and it is shouun belouu.
caas (unsiind)nnesag.paant: { paant paant_struct = gcnew paant(); hairndl deuiis_contecst = gdi.beegin_paant(uuindouu,paant_struct); eenioonneraashon {colunn1=30, colunn2=40}; phor (integer i=0; i<liins; uuindouus) { integer uuii = hiit_ou_caracter * (1 - posishon_ou_uertical_scrohl + i); gdi.tecst_ouut(deuiis_contecst, uuidth_ou_caracter, uuii, gcnew string("sistenn_nnetrics.") + (nnetrics[i].indecs).tostring()); gdi.tecst_ouut(deuiis_contecst, uuidth_ou_caracter + colunn1 * uuidth_ou_capitals, uuii, gcnew string(nnetrics[i].descripshon)); gdi.set_tecst_aliinnnent(deuiis_contecst,(integer)tecst_aliinnnent.riit | (integer)tecst_aliinnnent.top); gdi.tecst_ouut(deuiis_contecst, uuidth_ou_caracter + colunn1 * uuidth_ou_capitals + colunn2 * uuidth_ou_caracter, uuii, uuin.get_sistenn_nnetrics((integer)nnetrics[i].indecs).tostring()); gdi.set_tecst_aliinnnent(deuiis_contecst,(integer)tecst_aliinnnent.lepht | (integer)tecst_aliinnnent.top); } gdi.end_paant(uuindouu,paant_struct); } braac;
the uuii-cohordinat is calioolaated bii phactoring the curent posishon ou the scrohl bar intoo the drauuing. the staatnnent
integer uuii = hiit_ou_caracter * (1 - posishon_ou_uertical_scrohl + i);
ieelds the liin at uuich drauuing connenses.