{"id":344,"date":"2008-05-20T08:14:13","date_gmt":"2008-05-20T08:14:13","guid":{"rendered":"http:\/\/6teen.ru\/?p=144"},"modified":"2008-05-20T08:14:13","modified_gmt":"2008-05-20T08:14:13","slug":"4485","status":"publish","type":"post","link":"http:\/\/pblog.ru\/lab\/?p=344","title":{"rendered":"\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0433\u0440\u0430\u0444\u0438\u043a\u0438 \u0432 Listbox"},"content":{"rendered":"<p>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0433\u0440\u0430\u0444\u0438\u043a\u0438 \u0432 Listbox<br \/>\n<!--more--><\/p>\n<pre class=\"alt2\" style=\"margin:0px; padding:6px; border:1px inset; width:580px; height:320px; overflow:auto\"><div>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0433\u0440\u0430\u0444\u0438\u043a\u0438 \u0432 Listbox\n\n\u0423 \u043a\u043b\u0430\u0441\u0441\u0430 TLstbox (\u0438 TCombobox \u0442\u043e\u0436\u0435) \u0435\u0441\u0442\u044c \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e Style, \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u044e\u0449\u0435\u0435 \u043f\u043e\u0440\u044f\u0434\u043e\u043a \u0440\u0438\u0441\u043e\u0432\u0430\u043d\u0438\u044f \u043e\u0431\u044a\u0435\u043a\u0442\u0430. \u041f\u043e-\u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u043e\u043d\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043e \u0432 lbstandard \u0438 \u0437\u0430 \u0432\u043d\u0435\u0448\u043d\u0438\u0439 \u0432\u0438\u0434 \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 windows. \u0415\u0441\u043b\u0438 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u044d\u0442\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0432 lbownerdrawfixed \u0438\u043b\u0438 lbownerdrawvariable, \u0442\u043e \u043c\u043e\u0436\u043d\u043e \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0440\u0430\u0437\u043d\u043e\u043e\u0431\u0440\u0430\u0437\u0438\u0442\u044c \u0432\u043d\u0435\u0448\u043d\u0438\u0439 \u0432\u0438\u0434 \u043e\u0431\u044a\u0435\u043a\u0442\u0430. \u0420\u0430\u0437\u0431\u0438\u0440\u0430\u0442\u044c\u0441\u044f \u043b\u0443\u0447\u0448\u0435 \u0432\u0441\u0435\u0433\u043e \u043d\u0430 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435, \u0442\u0430\u043a \u0447\u0442\u043e \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u0441\u043e\u0437\u0434\u0430\u0442\u044c Lstbox, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u043b \u0438\u043c\u0435\u043d\u0430 \u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0444\u0430\u0439\u043b\u043e\u0432 \u043a\u0430\u043a\u043e\u0439-\u043d\u0438\u0431\u0443\u0434\u044c \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 \u0432\u043c\u0435\u0441\u0442\u0435 \u0441 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0430\u043c\u0438.\n\n\u0427\u0442\u043e\u0431\u044b \u0437\u0430\u043f\u043e\u043b\u043d\u0438\u0442\u044c Listbox \u043d\u0430\u0434\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435 (\u0447\u0442\u043e\u0431\u044b \u043a\u0430\u0436\u0434\u044b\u0439 \u0444\u0430\u0439\u043b \u043d\u0435 \u043f\u0440\u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u043e\u0441\u043b\u0430\u0442\u044c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435):\n\nprocedure tform1.button1click(sender: tobject);\nvar\ns : string;\nbegin\ns:='c:\\windows\\*.bmp'#0;\nlistbox1.perform(lb_dir, ddl_readwrite, longint(@s[1]));\nend;\n\n\u0417\u0434\u0435\u0441\u044c \u043c\u044b \u0443\u043a\u0430\u0437\u0430\u043b\u0438 listbox'\u0443, \u043a\u0430\u043a\u0438\u0435 \u0444\u0430\u0439\u043b\u044b \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0442\u044c.\n\u0423\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e style \u043d\u0443\u0436\u043d\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0432 lbownerdrawfixed \u0438 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0441\u043e\u0431\u044b\u0442\u0438\u044f ondrawitem:\n\nprocedure tform1.listbox1drawitem(control: twincontrol;\nindex: integer; rect: trect; state: townerdrawstate);\nvar bitmap: tbitmap;\noffset: integer;\nbmprect : trect;\nbegin\nwith (control as tlistbox).canvas do\nbegin\n{\u043e\u0447\u0438\u0449\u0430\u0435\u043c \u043f\u0440\u044f\u043c\u043e\u0443\u0433\u043e\u043b\u044c\u043d\u0438\u043a}\nfillrect(rect);\n{\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u043c \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0443}\nbitmap:=tbitmap.create;\nbitmap.loadfromfile('c:\\windows\\'+listbox1.items[index]);\nif bitmap <> nil then begin\n{\u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u043c \u043a\u0432\u0430\u0434\u0440\u0430\u0442 \u0434\u043b\u044f \u043f\u043e\u043a\u0430\u0437\u0430 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0438}\nbmprect:=bounds(rect.left + 2, rect.top + 2,\nrect.bottom-rect.top-2, rect.bottom-rect.top-2);\n{\u0440\u0438\u0441\u0443\u0435\u043c \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0443}\nstretchdraw(bmprect, bitmap);\noffset := rect.bottom-rect.top + 6;\nend;\n\n{\u0432\u044b\u0432\u043e\u0434\u0438\u043c \u0442\u0435\u043a\u0441\u0442}\n\ntextout(rect.left+offset,rect.top,listbox1.items[index]);\n{\u043d\u0435 \u0437\u0430\u0431\u044b\u0442\u044c \u043e\u0441\u0432\u043e\u0431\u043e\u0434\u0438\u0442\u044c!}\nbitmap.free;\nend;\nend;\n\n\u0427\u0442\u043e\u0431\u044b \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0438 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0438\u0441\u044c \u043f\u043e\u0431\u043e\u043b\u044c\u0448\u0435, \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 itemheight \u043c\u043e\u0436\u043d\u043e \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0442\u044c.\n<\/div><\/pre>\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0433\u0440\u0430\u0444\u0438\u043a\u0438 \u0432 Listbox<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[413,386],"tags":[466,680],"_links":{"self":[{"href":"http:\/\/pblog.ru\/lab\/index.php?rest_route=\/wp\/v2\/posts\/344"}],"collection":[{"href":"http:\/\/pblog.ru\/lab\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/pblog.ru\/lab\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/pblog.ru\/lab\/index.php?rest_route=\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"http:\/\/pblog.ru\/lab\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=344"}],"version-history":[{"count":0,"href":"http:\/\/pblog.ru\/lab\/index.php?rest_route=\/wp\/v2\/posts\/344\/revisions"}],"wp:attachment":[{"href":"http:\/\/pblog.ru\/lab\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=344"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/pblog.ru\/lab\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=344"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/pblog.ru\/lab\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=344"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}