CommunityVC.m 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599
  1. /**采取aspectFill来实现适配如何。
  2. 问题又来了。有时,需要固定高度怎么办。有时不需要。
  3. 不对啊。fill是可以实现屏幕等比缩放的啊。
  4. */
  5. #import "CommunityVC.h"
  6. #import "STButton.h"
  7. #import "CommunityCell.h"
  8. #import "TopicVC.h"
  9. #import "TopicesVC.h"
  10. #import "PostTopicVC.h"
  11. #import "DiaryVC.h"
  12. #import "LoginViewController.h"
  13. #import "MJRefresh.h"
  14. typedef NS_ENUM(NSInteger, MyGetDataType) {
  15. //正常请求数据
  16. MyGetDataTypeNomal=0,
  17. //下拉刷新请求数据
  18. MyGetDataTypeHeaderRefresh,
  19. //上拉加载更多请求数据
  20. MyGetDataTypeFooterRefresh
  21. };
  22. @interface CommunityVC ()<UIScrollViewDelegate,UITableViewDataSource,UITableViewDelegate,CommunityCellDelegate>
  23. {
  24. //全局的滚动视图
  25. UIScrollView* scroll;
  26. UIView* header;
  27. //头部的按钮标题。保存判断
  28. NSMutableArray* titles;
  29. UIPageControl* pageCtl;
  30. UITableView* myTableView;
  31. NSMutableArray* models;
  32. /**点击后滚动到头部的按钮
  33. */
  34. UIButton* gotoTopBtn;
  35. //记录页数
  36. NSInteger _currentPageNum;
  37. //正在加载的状态
  38. BOOL _IS_LOADING;
  39. //加载数据的类型
  40. MyGetDataType _getDataType;
  41. BOOL myschool;//是否存在我的驾校
  42. }
  43. @end
  44. @implementation CommunityVC
  45. - (void)viewDidLoad {
  46. [super viewDidLoad];
  47. [self myInit];
  48. }
  49. - (void)didReceiveMemoryWarning {
  50. [super didReceiveMemoryWarning];
  51. }
  52. -(void)viewDidAppear:(BOOL)animated
  53. {
  54. [super viewDidAppear:animated];
  55. if (_currentPageNum == 0) {
  56. [self getTopicInfos];
  57. }
  58. }
  59. -(void)viewWillDisappear:(BOOL)animated
  60. {
  61. [super viewWillDisappear:animated];
  62. }
  63. #pragma mark -
  64. /**注意这里是导航栏带来的Y值偏移
  65. */
  66. -(void)myInit
  67. {
  68. [self configNavigationBar];
  69. self.navigationController.navigationBar.translucent = NO;
  70. [self.view setBackgroundColor:[UIColor whiteColor]];
  71. [self setTitle:@"驾考社区"];
  72. models = [NSMutableArray array];
  73. _currentPageNum = 0;
  74. _IS_LOADING = NO;
  75. _getDataType = MyGetDataTypeNomal;
  76. CGFloat x,y,w,h,bd;
  77. UIBarButtonItem* backBbi ;
  78. backBbi = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"community3.png"] style:UIBarButtonItemStylePlain target:self action:@selector(btnClick:)];
  79. [backBbi setTintColor:defGreen];
  80. [backBbi setTag:-1];
  81. [self.navigationItem setRightBarButtonItem:backBbi];
  82. header = [[UIView alloc] initWithFrame:SGRectMake(0, 0, 320, 100)];
  83. x=0;
  84. w = kSize.width;
  85. y=0;
  86. h= kSize.height - kNavOffSet;
  87. NSInteger tag = 0;
  88. UIScrollView* sv = [[UIScrollView alloc] initWithFrame:CGRectMake(x, y, w, h)];
  89. [header addSubview:sv];
  90. scroll = sv;
  91. //最好是。它们的tag值不要变。
  92. NSArray* arr = @[@"吐槽",@"晒图",@"找驾校",@"科目一",@"科目二",@"科目三",@"科目四",@"下证",@"许愿"];//@"最新话题",
  93. titles = [NSMutableArray arrayWithArray:arr];
  94. arr = @[@"community_img02.png",@"community_img03.png",@"community_img04.png",@"community_img05.png"
  95. ,@"community_img07.png",@"community_img08.png",@"community_img09.png",@"community_img10.png",@"subject2_standart_icon.png"];//@"community_img01.png",
  96. NSMutableArray* images = [NSMutableArray arrayWithArray:arr];
  97. //如果有我的驾校 就在这里插入我的驾校信息
  98. NSString* str = [defUser.userSchDict objectForKey:@"shortName"];
  99. myschool = NO;
  100. if (str && str.length > 0) {
  101. myschool = YES;
  102. [titles insertObject:str atIndex:0];
  103. [images insertObject:@"learn_img03.png" atIndex:0];
  104. }
  105. w = 320 / 5.0;
  106. h = w*1;
  107. sv = [[UIScrollView alloc] initWithFrame:SGRectMake(0, 0, 320, h)];
  108. [sv setTag:0];
  109. [header addSubview:sv];
  110. sv.scrollEnabled = YES;
  111. sv.contentSize = SGSizeMake(w*titles.count, 0);
  112. sv.showsHorizontalScrollIndicator = NO;
  113. sv.pagingEnabled = YES;
  114. [sv setDelegate:self];
  115. tag += 1;
  116. for (int i = 0; i<titles.count; i++)
  117. {
  118. STButton* btn = [[STButton alloc] initWithFrame:SGRectMake(w*i, 0, w, h)];//h=96
  119. [btn setImage:[UIImage imageNamed:images[i]] withTitle:titles[i] Font:NormalFont forState:UIControlStateNormal];
  120. [btn addTarget:self action:@selector(btnClick:) forControlEvents:UIControlEventTouchUpInside];
  121. [btn setTag:tag++];//1-count
  122. [sv addSubview:btn];
  123. if (str && 0 == i) {
  124. if (str.length > 4) {
  125. [btn setTitle:[titles[0] substringToIndex:4] forState:UIControlStateNormal];
  126. [btn setSubTitle:[str substringFromIndex:4] font:NormalFont color:kTitleColor];
  127. }
  128. }
  129. }
  130. UIPageControl* page = [[UIPageControl alloc] initWithFrame:SGRectMake(0, h - 20, 320, 20)];
  131. [header addSubview:page];
  132. page.currentPageIndicatorTintColor = defGreen;
  133. page.pageIndicatorTintColor = KlineColor;
  134. // if (myShcool == NO) {
  135. // page.numberOfPages = 2;
  136. // [sv setContentSize:CGSizeMake(kSize.width * 2, 0)];
  137. // }else{
  138. // page.numberOfPages = 3;
  139. // [sv setContentSize:CGSizeMake(kSize.width * 3, 0)];
  140. // }
  141. page.numberOfPages = 2;
  142. [sv setContentSize:CGSizeMake(kSize.width * 2, 0)];
  143. page.userInteractionEnabled = NO;
  144. pageCtl = page;
  145. y = h ;
  146. h = 25;
  147. UILabel *label;
  148. label = [[UILabel alloc] initWithFrame:SGRectMake(20, y, 320 -20, h)];
  149. [label setText:@"热门话题"];
  150. [label setTextColor:contentTextColor];
  151. [header addSubview:label];
  152. [label addViewWithRect:SGRectMake(0, y+h -1, 320, 1)];
  153. header.frame = SGRectMake(0, 0, 320 , y+h);
  154. UITableView* tv = [[UITableView alloc] initWithFrame:CGRectMake(0, 0, kSize.width, kSize.height -kNavOffSet-kSafeAreaBottomHeight)];
  155. [self.view addSubview:tv];
  156. [tv setDelegate:self];
  157. [tv setDataSource:self];
  158. tv.tableHeaderView = header;
  159. tv.tableFooterView = [[UIView alloc] initWithFrame:CGRectZero];
  160. [tv setTag:1];
  161. if ([tv respondsToSelector:@selector(setSeparatorInset:)])
  162. {
  163. [tv setSeparatorInset:UIEdgeInsetsZero];
  164. }
  165. if ([tv respondsToSelector:@selector(setLayoutMargins:)])
  166. {
  167. [tv setLayoutMargins:UIEdgeInsetsZero];
  168. }
  169. myTableView = tv;
  170. //刷新
  171. [self setRefreshAction];
  172. UIButton* btn ;
  173. bd = 15;
  174. h = w = 35;
  175. x = kSize.width - w - bd;
  176. y = kSize.height - 2* w - kNavOffSet;
  177. btn = [[UIButton alloc] init];
  178. [btn setFrame:CGRectMake(x, y, w, h)];
  179. [btn setImage:[UIImage imageNamed:@"community5.png"] forState:UIControlStateNormal];
  180. [btn addTarget:self action:@selector(btnClick:) forControlEvents:UIControlEventTouchUpInside];
  181. [btn setFrame:CGRectMake(x, y, w, h)];
  182. [btn setBackgroundColor:defGreen];
  183. [btn borderColor:defGreen width:1 cornorRadios:w/2.0];
  184. [self.view addSubview:btn];
  185. [btn setTag:-3];
  186. y -= bd+h;
  187. btn = [[UIButton alloc] init];
  188. [btn setFrame:CGRectMake(x, y, w, h)];
  189. [btn setImage:[UIImage imageNamed:@"location_more_arrow.png"] forState:UIControlStateNormal];
  190. [btn addTarget:self action:@selector(btnClick:) forControlEvents:UIControlEventTouchUpInside];
  191. [btn setBackgroundColor:[UIColor whiteColor]];
  192. [btn borderColor:KlineColor width:1 cornorRadios:w/2.0];
  193. [self.view addSubview:btn];
  194. btn.transform = CGAffineTransformMakeRotation(M_PI);
  195. [btn setTag:-2];
  196. gotoTopBtn = btn;
  197. btn.hidden = YES;
  198. [RACObserve(RQ_SHARE_FUNCTION, shieldTopicIDArr) subscribeNext:^(NSArray *arr) {
  199. if (arr.count > 0 && models.count >0) {
  200. NSMutableArray *arrs = [NSMutableArray array];
  201. [[models.rac_sequence.signal filter:^BOOL(NSDictionary *dic) {
  202. return ![arr containsObject:dic[@"ID"]];
  203. }] subscribeNext:^(NSDictionary *dic) {
  204. [arrs addObject:dic];
  205. } completed:^{
  206. models = arrs;
  207. dispatch_sync(dispatch_get_main_queue(), ^{
  208. [myTableView reloadData];
  209. });
  210. }];
  211. }
  212. }];
  213. [RACObserve(RQ_SHARE_FUNCTION, shieldPeopleIDArr) subscribeNext:^(NSArray *arr) {
  214. if (arr.count > 0 && models.count >0) {
  215. NSMutableArray *arrs = [NSMutableArray array];
  216. [[models.rac_sequence.signal filter:^BOOL(NSDictionary *dic) {
  217. return ![arr containsObject:dic[@"TI_CRUSER"]];
  218. }] subscribeNext:^(NSDictionary *dic) {
  219. [arrs addObject:dic];
  220. } completed:^{
  221. models = arrs;
  222. dispatch_sync(dispatch_get_main_queue(), ^{
  223. [myTableView reloadData];
  224. });
  225. }];
  226. }
  227. }];
  228. }
  229. /**这里有个很有意思的事情。self已经present到vc了。可是self.nav却push到其他地方了。--尚未发现问题--danson
  230. */
  231. -(void)btnClick:(UIButton*)sender
  232. {
  233. NSInteger tag = sender.tag;
  234. if (-3 == tag ||-1 == tag ) {
  235. if (!myDelegate.isLogin) {
  236. [LoginViewController loginFromVC:self];
  237. return;
  238. }
  239. }
  240. if (-3 == sender.tag) {
  241. PostTopicVC* vc = [[PostTopicVC alloc] init];
  242. [vc complete:^{
  243. [models removeAllObjects];
  244. _currentPageNum = 0;
  245. //viewdidappear里面会刷新
  246. }];
  247. vc.type = @"1";
  248. [self navPushHideTabbarToVC:vc];
  249. }
  250. if (-2 == sender.tag) {
  251. [UIView animateWithDuration:.5 animations:^{
  252. gotoTopBtn.alpha = 0;
  253. } completion:^(BOOL finished) {
  254. [gotoTopBtn setHidden:YES];
  255. }];
  256. [myTableView setContentOffset:CGPointMake(0, 0) animated:YES];
  257. }
  258. if (-1 == sender.tag) {
  259. DiaryVC* vc = [[DiaryVC alloc] init];
  260. vc.userID = defUser.userDict[@"id"];
  261. [self navPushHideTabbarToVC:vc];
  262. }
  263. //这里要判断一下点击了那个按钮。接口里面没有最新话题。算了。最新话题。就传个0过去好了。
  264. if (0 <= sender.tag) {
  265. TopicesVC* vc = [[TopicesVC alloc] init];
  266. vc.type = @"1";
  267. if (myschool == NO) {
  268. //没有驾校. 1-9
  269. vc.groupId = [NSString stringWithFormat:@"%d",(int)tag];
  270. }else{
  271. //有驾校 0,-1,1-10
  272. // if (0 == tag) {//辽宁“最新话题”已经去掉
  273. // vc.groupId = @"0";
  274. // }
  275. if (1 == tag) {
  276. vc.groupId = @"-1";
  277. vc.jxbh = @"";
  278. vc.jxjc = @"";
  279. }
  280. if (1 < tag ) {
  281. vc.groupId = [NSString stringWithFormat:@"%d",(int)tag-1];
  282. }
  283. }
  284. [self navPushHideTabbarToVC:vc];
  285. }
  286. }
  287. -(void)gotoComment:(NSString *)comId
  288. {
  289. if (!myDelegate.isLogin) {
  290. LoginViewController* vc = [[LoginViewController alloc] init];
  291. vc.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
  292. vc.modalPresentationStyle = UIModalPresentationFullScreen;
  293. [self presentViewController:vc animated:YES completion:nil];
  294. }else{
  295. TopicVC* vc = [[TopicVC alloc] init];
  296. [vc setTopicId:comId];
  297. [vc setTextViewActive:YES];
  298. [self navPushHideTabbarToVC:vc];
  299. }
  300. }
  301. -(void)didPoint:(NSDictionary *)dict
  302. {
  303. // NSLog(@"didPoint->%@",dict);
  304. [self uploadTopicCommentPoints:dict];
  305. }
  306. -(void)didDePoint:(NSDictionary *)dict
  307. {
  308. // NSLog(@"didDePoint->%@",dict);
  309. [self deleteTopicCommentPoints:dict];
  310. }
  311. #pragma mark - 下拉刷新,上拉加载 -
  312. -(void)setRefreshAction{
  313. // 下拉刷新
  314. __weak typeof(self) weakSelf = self;
  315. MJRefreshNormalHeader *mj_header = [MJRefreshNormalHeader headerWithRefreshingBlock:^{
  316. [weakSelf headerRefresh];
  317. }];
  318. myTableView.mj_header = mj_header;
  319. MJRefreshBackNormalFooter *mj_footer = [MJRefreshBackNormalFooter footerWithRefreshingBlock:^{
  320. [weakSelf footerRefresh];
  321. }];
  322. myTableView.mj_footer = mj_footer;
  323. //先这样处理吧 我也很绝望啊
  324. //隐藏底部“上拉加载更多”
  325. // 设置了底部inset
  326. myTableView.contentInset = UIEdgeInsetsMake(0, 0, 30, 0);
  327. // 忽略掉底部inset
  328. myTableView.mj_footer.ignoredScrollViewContentInsetBottom = 30;
  329. }
  330. -(void)headerRefresh{
  331. //设置获取数据的方式
  332. _getDataType=MyGetDataTypeHeaderRefresh;
  333. //加载数据
  334. [self getTopicInfos];
  335. [myTableView.mj_header endRefreshing];
  336. }
  337. -(void)footerRefresh{
  338. //设置获取数据的方式
  339. _getDataType=MyGetDataTypeFooterRefresh;
  340. //加载数据
  341. [self getTopicInfos];
  342. [myTableView.mj_footer endRefreshing];
  343. }
  344. #pragma mark -
  345. -(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
  346. {
  347. return communityCellHeight(models[indexPath.row] , 0);
  348. }
  349. - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
  350. {
  351. return models.count;
  352. }
  353. - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
  354. {
  355. CommunityCell* cell = [CommunityCell cellForTableView:tableView Style:0];
  356. [cell setShowTag:YES];
  357. //用于通知VC跳转到评论
  358. [cell setDelegate:self];
  359. [cell setModel:models[indexPath.row]];
  360. return cell;
  361. }
  362. -(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
  363. {
  364. [tableView deselectRowAtIndexPath:indexPath animated:YES];
  365. NSDictionary* dict = models[indexPath.row];
  366. TopicVC* vc = [[TopicVC alloc] init];
  367. [vc setTopicId:dict[@"ID"]];
  368. vc.userId = dict[@"TI_CRUSER"];
  369. [self navPushHideTabbarToVC:vc];
  370. }
  371. - (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath
  372. {
  373. if ([cell respondsToSelector:@selector(setSeparatorInset:)])
  374. {
  375. [cell setSeparatorInset:UIEdgeInsetsZero];
  376. }
  377. if ([cell respondsToSelector:@selector(setLayoutMargins:)])
  378. {
  379. [cell setLayoutMargins:UIEdgeInsetsZero];
  380. }
  381. }
  382. #pragma mark -
  383. -(void)getTopicInfos
  384. {
  385. //判断当前是否正在加载数据。如果正在加载数据,直接return。
  386. if (_IS_LOADING) {
  387. return;
  388. }
  389. if (![Util connectedToNetWork]) {
  390. showMsgUnconnect();
  391. return;
  392. }
  393. _IS_LOADING=YES;
  394. //获取第一页数据
  395. NSInteger needLoadPage;
  396. needLoadPage=_currentPageNum+1;
  397. if (_getDataType==MyGetDataTypeHeaderRefresh) {
  398. needLoadPage=1;
  399. }
  400. NSMutableArray *arr=[NSMutableArray array];
  401. //默认查询的是所有 所以groupId传空值 文档上好像说 -1 是空 danson
  402. [arr addPro:@"groupId" Value:@""];
  403. [arr addPro:@"type" Value:@"1"];
  404. [arr addPro:@"crUser" Value:defUser.userDict[@"id"]];
  405. [arr addPro:@"isPage" Value:@"1"];
  406. [arr addPro:@"pageSize" Value:@"10"];
  407. [arr addPro:@"currentPage" Value:[NSString stringWithFormat:@"%ld",(long)needLoadPage]];
  408. //如果话题上传类型type为2 则添加字段 childGroup
  409. NSString* method = @"getTopicInfos";
  410. [MBProgressHUD showLoadToView:self.view];
  411. [jiaPeiManager requestAnythingWithURL:method array:arr data:nil completion:^(NSDictionary *dict) {
  412. [MBProgressHUD hideHUDForView:self.view];
  413. _IS_LOADING=NO;
  414. //NSLog(@"%@,%@,%@",arr,dict,xml);
  415. if (!dict) {
  416. ShowMsgFailed();
  417. return;
  418. }
  419. if ( [dict[@"code"] isEqualToString:@"1"]) {
  420. ShowMsg(dict[@"body"]);
  421. return;
  422. }
  423. //处理数据
  424. //如果获取到了数据,而且是下拉刷新,清空数组。
  425. if (_getDataType==MyGetDataTypeHeaderRefresh){
  426. [models removeAllObjects];
  427. }
  428. //追加数据
  429. NSArray *arr = dict[@"body"];
  430. [[arr.rac_sequence.signal filter:^BOOL(NSDictionary *dic) {
  431. return ![RQ_SHARE_FUNCTION.shieldTopicIDArr containsObject:dic[@"ID"]] && ![RQ_SHARE_FUNCTION.shieldPeopleIDArr containsObject:dic[@"TI_CRUSER"]] ;
  432. }] subscribeNext:^(NSDictionary *dic) {
  433. [models addObject:dic];
  434. } completed:^{
  435. dispatch_sync(dispatch_get_main_queue(), ^{
  436. if (models.count == 0) {
  437. ShowMsg(@"已加载全部");
  438. }else{
  439. //计数器+1
  440. _currentPageNum=needLoadPage;
  441. }
  442. [myTableView reloadData];
  443. //恢复初始状态。
  444. _getDataType=MyGetDataTypeNomal;
  445. });
  446. }];
  447. }];
  448. }
  449. -(void)deleteTopicCommentPoints:(NSDictionary*)obj
  450. {
  451. if (![Util connectedToNetWork]) {
  452. showMsgUnconnect();
  453. return;
  454. }
  455. NSMutableArray* arr = [NSMutableArray array];
  456. [arr addPro:@"user" Value:defUser.userDict[@"id"]];
  457. [arr addPro:@"topicId" Value:obj[@"ID"]];
  458. NSString* method = @"deleteTopicCommentPoints";
  459. [jiaPeiManager requestAnythingWithURL:method array:arr data:nil completion:^(NSDictionary *root) {
  460. if (!root) {
  461. ShowMsgFailed();
  462. return;
  463. }
  464. }];
  465. }
  466. -(void)uploadTopicCommentPoints:(NSDictionary*)obj
  467. {
  468. if (![Util connectedToNetWork]) {
  469. showMsgUnconnect();
  470. return;
  471. }
  472. NSMutableArray* arr = [NSMutableArray array];
  473. [arr addPro:@"user" Value:defUser.userDict[@"id"]];
  474. [arr addPro:@"topicId" Value:obj[@"ID"]];
  475. NSString* method = @"uploadTopicCommentPoints";
  476. [jiaPeiManager requestAnythingWithURL:method array:arr data:nil completion:^(NSDictionary *root) {
  477. if (!root) {
  478. ShowMsgFailed();
  479. return;
  480. }
  481. }];
  482. }
  483. //根据判断表是否被拉到底部 来实现下拉加载的 没有上拉刷新操作 如果有必要 下个版本可以实现
  484. -(void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView
  485. {
  486. if(scrollView.tag > 0)
  487. {
  488. //tableview
  489. CGPoint off = scrollView.contentOffset;
  490. if (off.y < 100) {
  491. [UIView animateWithDuration:.5 animations:^{
  492. gotoTopBtn.alpha = 0;
  493. } completion:^(BOOL finished) {
  494. [gotoTopBtn setHidden:YES];
  495. }];
  496. }else if (gotoTopBtn.hidden) {
  497. [gotoTopBtn setHidden:NO];
  498. gotoTopBtn.alpha = .2;
  499. [UIView animateWithDuration:.7 animations:^{
  500. gotoTopBtn.alpha = 1;
  501. } ];
  502. }
  503. }else{
  504. //顶部
  505. NSInteger pInd = (int)(scrollView.contentOffset.x / kSize.width);
  506. pageCtl.currentPage = pInd% pageCtl.numberOfPages;
  507. }
  508. }
  509. @end